It opens the given file with the given mode and return the
file
handler
Using this file handler all other file handling functions can be
done
In write (w) mode it creates a new file ,but not in read(r,r+),append(a)mode.
Example of PHP fopen() FunctionCode for PHP fopen() Function
<?php
$file1=fopen("c:/rose1/ram.txt","r");
if(!$file1)
echo "file is
not existing ";
else
echo "file
exists";
?> Output
file exists