Definition :
The fclose() function in PHP is an inbuilt function which is used to close a file which is pointed by an open file pointer
Syntax:
fclose( $file )
Parameters: The fclose() function in PHP accepts only one parameter which is $file. This parameter specifies the file which has to be close.
Errors And Exception:
Given below example Open and close file "demo.txt":