Example #1 touch() example

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


Example #2 touch() using the time parameter

<?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';
}
?>ting.

文章標籤
全站熱搜
創作者介紹
創作者 stockwfj3 的頭像
stockwfj3

程式設計@筆記

stockwfj3 發表在 痞客邦 留言(0) 人氣(190)