PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  
<tmpfileumask>
Last updated: Mon, 16 Jul 2012

touch

(PHP 3, PHP 4, PHP 5)

touch -- 设定文件的访问和修改时间

说明

bool touch ( string filename [, int time [, int atime]] )

尝试将由 filename 给出的文件的访问和修改时间设定为给出的时间。如果没有给出可选参数 time,则使用当前时间。这和 utime(有时也叫做 utimes)所作的等价。如果给出了第三个参数 atime,则给定文件的访问时间会被设为 atime。注意访问时间总是会被修改的,不论有几个参数。

如果文件不存在,则会被创建。如果成功则返回 TRUE,失败则返回 FALSE

例子 1. touch() 例子

<?php
if (touch ($FileName)) {
   print
"$FileName modification time has been
           changed to todays date and time"
;
} else {
   print
"Sorry Could Not change modification time of $FileName";
}
?>




<tmpfileumask>
 Last updated: Mon, 16 Jul 2012
 
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://manual.phpv.net/
Last updated: Thu Jul 7 19:13:47 2005 CST