fclose() function closes the file : fclose « File Directory « PHP






fclose() function closes the file

 
int fclose (int filepointer)

<?
    $file = "data.txt";
    if (file_exists($file)) :
         $fh = fopen($file, "r");
         fclose($fh);
    else:
         print "File $file does not exist!";
    endif;
?>
  
  








Related examples in the same category

1.Close a file you have opened with fopen( ), use fclose( ).