How to close the file by php
In this issue, the editor will bring you about how to operate the php closing file. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.
In php, you can use the fclose () function to close a file, which closes an open file pointer with the syntax "fclose ($handle)"; how to close successfully returns TRUE and fails to return FALSE.
Operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
The resource type is one of the basic types of PHP. Once you have finished processing the resource, be sure to turn it off, otherwise some unexpected errors may occur.
The function fclose () closes an open file pointer and returns TRUE on success and FALSE on failure. The syntax format of the function is as follows:
Fclose (resource $handle)
Where $handle is the pointer to the file to be closed, which must be valid and opened successfully through the fopen () or fsockopen () function.
[example] use fclose () to close the file pointer.
The running results are as follows:
Before the file pointer is closed: resource (3) of type (stream) after the file pointer is closed: resource (3) of type (Unknown)
Undefined
The above is the editor for you to share the php closed file how to operate, if you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.