Example
Open and close file "test.txt":
html
<?php
$file = fopen("test.txt", "r");
fclose($file);
?>
Definition and Usage
The fclose() function closes an open file pointer.
Note: The file must have been opened by fopen() or fsockopen().
Syntax
text
fclose(filepointer)
Parameter Values
| Parameter | Description |
|---|---|
| filepointer | Required. Specifies the file to close |
Technical Details
| Return Value: | TRUE on success, FALSE on failure |
|---|---|
| PHP Version: | 4.0+ |