Close a file you have opened with fopen( ), use fclose( ). : fclose « File Directory « PHP






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

 
<?
    $filename = 'data.txt';
    $handle = fopen($filename, "rb");
    $contents = fread($handle, filesize($filename));
    fclose($handle);
    print $contents;
?>
  
  








Related examples in the same category

1.fclose() function closes the file