php creates temporary files
The files we created before are permanent files.
Creating temporary files is also very useful in our daily project development. Several benefits of creating temporary files:
Delete after finishing writing
No need to maintain the deletion status of this file
For example: I need to transfer the content of A’s file Save it in B and transfer the file contents of B to C.
Just like in real life, I can first use a temporary bottle to fill B's water, and then write A's data into B. Add the water from the temporary bottle to C.
Let’s learn this function:
resource tmpfile ( )
Function: Create a temporary file and return the resource type. The file is deleted when it is closed.