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)