yeah

搜索

计数器

62875

链接

URL重定向
php对象<=>数组互转

设置文件的修改时间

yeah posted @ Dec 24, 2009 01:45:13 AM in PHP学习 with tags 设置文件的修改时间 , 966 阅读

 

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

<?php
if (touch($FileName)) {
    echo "$FileName modification time has been changed to present time";
} else {
    echo "Sorry, could not change modification time of $FileName";
}
?>

<?php
/*
 * This is the touch time, we'll set it to one hour
 * in the past.
 */

$time = time() - 3600;

/* Touch the file */
if(!touch('some_file.txt', $time))
{
    echo 'Whoops, something went wrong...';
}
else
{
    echo 'Touched file with success';
}
?>

登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter