Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Different ways to open file in PHP

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 85
    Comment on it

    Ways to open a file in PHP are given below:

    1. r: Open a file for read only. File pointer points at the beginning of the file.

    2. w: Open a file for write only. File pointer begins at the beginning of the file. It erases all the data of the file or create a new file if file does't exist and start writing from the beginning of the file.

    3. a: Open a file for write only. File pointer starts at the end of the file. If the file doesn't exist it will create a new file.

    4. x: Creates a new file for write only purpose and return false if the file already exist.

    5. r+: It opens a file for read/write purpose. File pointer points at the beginning of the file.

    6. w+: It opens a file for read/write purpose. File pointer begins at the beginning of the file. It erases all the data of the file or create a new file if file does't exist and start writting from the beginning of the file.

    7. a+: Open a file for read/write only. File pointer starts at the end of the file. If the file doesn't exist it will create a new file.

    8. x+: It will create a new file for read/write purpose and return false if the file already exist.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: