tempnam() function is one of the PHP built-in functions that creates a temporary file in the specified directory and returns the pathname of the file. Its function prototype is as follows:
string tempnam ( string $dir , string $prefix )among $dir The parameter is the path to the specified directory. If not provided, the system's temporary folder path will be used by default.$prefix The argument is an optional filename prefix that, if provided, will be prepended to the generated filename.
tempnam() The function creates a unique file name in the specified directory that can be used to create temporary files, such as to save temporary files during file downloads and uploads.
After using the temporary file, you need to delete the file in time, otherwise it may occupy system resources and cause security risks.