September 2001
Intermediate to advanced
768 pages
32h 45m
English
bool fclose(resource file_handle) Closes a file.
Returns:
TRUE on success; FALSE on error
Description:
Closes a file opened by fopen() or fsockopen(). Closing a file handle ensures that any buffered data is written to the file. This behavior can be the cause of relatively subtle bugs when working with files.
Warning:
3.0.6, 3.0.11: Doesn’t seem to close TCP sockets on Linux, already reported with 3.0.6.
3.0.7: May cause PHP to crash on Red Hat Linux 5.2.
Example:
$fh = fopen ("test.txt", "r");
fclose ($fh);
|
Read now
Unlock full access