かずきち。の日記

サーバサイドエンジニアのつぶやき

最新スレッドの検出

$fname = ".php";

$show = 0;
for($i = 1000;$i > 0; $i--){
if(file_exists("log/".$i.$fname)){
$file = fopen("log/".$i.$fname, "r") or die();

$count = 0;
while($array = fgetcsv($file, 10000, "<>")){
if($array[7] != null && $count == 1 && $show <30){
print "".mb_convert_encoding(substr($array[7],1),"utf-8","SJIS");
}
$count++;
}
print " (".($count-1)."res) ";
$show++;
if($show == 4 || $show == 9 || $show == 14 || $show == 19 || $show == 24){
print "
";
}
}
}

fclose($file);