Closing files

fclose() to close files or URL

 

fclose( $fileHandle ) ;

 

Good practice to close a file:

<?php
	$fileHandle = fopen ( "myFile.txt", "r" ) ;

	//code to be executed

	fclose( $fileHandle ) ;

?>

Leave a Reply