fclose()函數(shù)關(guān)閉所有打開(kāi)的文件,如果成功,則返回true;如果失敗,則返回false。
bool fclose ( resource $handle )
文件指針必須有效,并且必須指向由fopen()或fsockopen()函數(shù)成功打開(kāi)的文件。
<?php $handle = fopen("/PhpProject/sample.txt", "r"); fclose($handle); echo "File closed succsssfully"; ?>
輸出結(jié)果
File closed succsssfully