評等結果
點擊便能為這篇文章進行評等!
[評等總次數: 0,平均評等: 0]
[php]
<?php
function listdir_by_date($path){
$dir = opendir($path);
$list = array();
while($file = readdir($dir)){
if ($file != ‘.’ and $file != ‘..’){
$mtime = filemtime($data_path . $file) . ‘,’ . $file;
$list[$mtime] = $file;
}
}
closedir($dir);
krsort($list);
return $list;
}
$show=listdir_by_date(‘./’);
$today=date ("Y-m-d");
echo ‘<b>change today</b><br/>’;
foreach ($show as $value){
echo (date ("Y-m-d", filemtime($value))==$today?$value.'[ ‘.date ("Y-m-d H:i:s", filemtime($value)).’ ]’.'<br/>’:”);
}
?>
[/php]
結果顯示
change today
test.php[ 2015-06-25 21:35:56 ]
test2.php[ 2015-06-25 20:14:28 ]
test3.php[ 2015-06-25 20:08:27 ]
評等結果
點擊便能為這篇文章進行評等!
[評等總次數: 0,平均評等: 0]