array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'pt_BR', ), 'this' => array ( 0 => 'function.sys-get-temp-dir.php', 1 => 'sys_get_temp_dir', ), 'up' => array ( 0 => 'ref.info.php', 1 => 'Funções para Opções/Info do PHP', ), 'prev' => array ( 0 => 'function.set-time-limit.php', 1 => 'set_time_limit', ), 'next' => array ( 0 => 'function.version-compare.php', 1 => 'version_compare', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/info/functions/sys-get-temp-dir.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 5 >= 5.2.1, PHP 7, PHP 8)
sys_get_temp_dir — Returns directory path used for temporary files
Returns the path of the directory PHP stores temporary files in by default.
Esta função não possui parâmetros.
Returns the path of the temporary directory.
Exemplo #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;
?>
O exemplo acima produzirá algo semelhante a:
C:\Windows\Temp\TuxA318.tmp