How to Get the Location of Temp Files in PHP
- 1). Create a new PHP file using an editor or the Notepad.
- 2). Call the "sys_get_temp_dir" function to discover the location of PHP temporary files on the Web server. For example, type:
<?php
$location = sys_get_temp_dir();
echo "Temporary files are stored on the Web server at " . $location;
?> - 3). Save the file and run it in a browser. Review the output to ensure it prints a temporary location.