Share on Google+Share on Google+

Function fclose() in php, PHP Close file, fclose php


The fclose() function example in PHP. Learn how to use the fclose() function in your php program.

The example of fclose() function in php.

If you have opened any file from your program, then after performing the file operations you must close the file pointer. The fclose() function is used to close the find pointer.


boolean fclose($file_pointer)

It is used for closing the  file pointer returned by fopen() and fsockopen()

It returns True on closing the file pointer

It returns False if unable to close the file pointer

By closing it releases the memory acquired by the file pointer

It works with PHP 4, PHP 5

Code for fclose() Function in PHP



echo fread($file,100);



echo $t;


welcome to roseindia




Posted on: September 21, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.


Advertisement null