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


 

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 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

 

Ads