English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The fclose() function closes all open files. If successful, it returns true; if unsuccessful, it returns false.
bool fclose ( resource $handle )
The file pointer must be valid and must point to a file that was successfully opened by the fopen() or fsockopen() function.
<?php $handle = fopen("/PhpProject/sample.txt", "r"); fclose($handle); echo "File closed succsssfully"; ?>
Output result
File closed succsssfully