首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

sys_get_temp_dir

(PHP 5 >= 5.2.1, PHP 7)

sys_get_temp_dir — Returns directory path used for temporary files

Description

代码语言:javascript
复制
string sys_get_temp_dir ( void )

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

Return Values

Returns the path of the temporary directory.

Examples

Example #1 sys_get_temp_dir() example

代码语言:javascript
复制
<?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;
?>

The above example will output something similar to:

代码语言:javascript
复制
C:\Windows\Temp\TuxA318.tmp

See Also

  • tmpfile() - Creates a temporary file
  • tempnam() - Create file with unique file name

← set_time_limit

version_compare →

代码语言:txt
复制
 ? 1997–2017 The PHP Documentation Group

Licensed under the Creative Commons Attribution License v3.0 or later.

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com