$filepath=file("data.txt");//ファイルを開いて配列にする。 $fd = array_reverse($filepath);//配列を逆にする。 echo count($fd);//配列の数 データ数 for($i=0;$i