Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • fopen() & fwrite() function in PHP

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 251
    Comment on it

    fopen() function is used to open files. it contain 2 parameters, first parameter specify the name of file to be open & second one specifies in which mode file should be open. This function also used to create file.

    Example

    <?php
        $myfile = fopen ( "xyz.txt" , "a+" );
        fwrite ($myfile);
    ?>
    

    fopen() method opens the file & if it does not able to find file then it will automatically create a new file with name given as a parameter.

    $myfile is variable name assign to the file.

    fwrite() method writes the content in the file that you specified.

 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: