phpでディレクトリの中身を表示する。
$arryay_file = array();
if ($dir = opendir(LOGFILEDIR)) {
$ii = 0;
while (($file = readdir($dir)) !== false) {
if ($file != “.” && $file != “..”) {
if($_GET[itemno] > $ii){
$ii++;
next;
} else {
if (preg_match(‘/csv/’,$file)) {
$fitime = date( “Y年m月d日”, filemtime(LOGFILEDIR.”/”.$file) );
$arryay_file[$ii][“file”] = $file;
$arryay_file[$ii][“fitime”] = $fitime;
$arryay_file[$ii][“file_url”] = LOGFILEDIR.”/”.$file;
$ii++;
}
}
}
}
closedir($dir);
}
LOGFILEDIRにディレクトリパス
filemtime(LOGFILEDIR.”/”.$file) でファイル更新日を取得
$arryay_fileに配列でデータが入る