PHP Portal » PHP Handbuch » sys_get_temp_dir

Werbung

sys_get_temp_dir


(PHP 5 >= 5.2.1)

sys_get_temp_dirReturns directory path used for temporary files

Beschreibung

string sys_get_temp_dir ( void )

Returns the path of the directory PHP stores temporary files in by default.

Rückgabewerte

Returns the path of the temporary directory.

Beispiele

PHP Code
1
2
3
4
5
// Create a temporary file in the temporary // files directory using sys_get_temp_dir() $temp_file = tempnam(sys_get_temp_dir(), 'Tux'); echo $temp_file;

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

C:\Windows\Temp\TuxA318.tmp

Siehe auch

  • tmpfile() - Erstellt eine temporäre Datei
  • tempnam() - Erzeugt eine Datei mit eindeutigem Dateinamen