sys_get_temp_dir
PHP Manual
PHP Manual»Функції налаштування та отримання інформації про PHP»sys_get_temp_dir

sys_get_temp_dir

(PHP 5 >= 5.2.1, PHP 7, PHP 8)

sys_get_temp_dirReturns directory path used for temporary files

Опис

function sys_get_temp_dir(): string

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

Параметри

У цієї функції немає параметрів.

Значення, що повертаються

Returns the path of the temporary directory.

Приклади

Приклад #1 sys_get_temp_dir() example

<?php
// 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;
?>

Поданий вище приклад виведе щось схоже на:

C:\Windows\Temp\TuxA318.tmp

Прогляньте також

To Top