How does PHP handle temporary files after script execution?

PHP handles temporary files after script execution by automatically deleting them if they were created using functions like `tmpfile()` or `tempnam()`. However, if temporary files were created using `fopen()` or `file_put_contents()`, they need to be manually deleted using `unlink()`.

// Create a temporary file using fopen()
$tempFile = fopen('temp.txt', 'w');
fwrite($tempFile, 'Hello, World!');
fclose($tempFile);

// Code execution

// Delete the temporary file after script execution
unlink('temp.txt');