Home Tutorial Php Phpfiles Function fclose() in php, PHP Close file, fclose php

 
 

Share on Google+Share on Google+
Function fclose() in php, PHP Close file, fclose php
Posted on: September 21, 2009 at 12:00 AM
Advertisement
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.

Syntax

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

<?php

$file=fopen("c:/xampp/htdocs/aa.php","r");

echo fread($file,100);

echo"<br/>";

$t=fclose($file);

echo $t;

?>

welcome to roseindia
1

 

Advertisement

Related Tags for Function fclose() in php, PHP Close file, fclose php:


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.

Posted on: September 21, 2009

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com