<?php
$file = 'id.txt';
$content = file_get_contents($file);
$array = explode(\n,$content);
//各个系统下的换行符可能会有所不同,不过用得比较多的好像是\n
//count($array) 总共数据
for($i = 0; $i < count($array); $i ++) {
//读取一行的信息,如:29384733----2013-12-29 19:57:20
$temp = $array[$i];
$items = split(----,$temp);
//假设如题设中的以----为不同字段之间的分隔符,如果是其他的,相应修改即可,视具体分隔符而定
echo id: .$record [0] . timestamp: . $record [1] . ;
}
/*** 以上代码来自:编程之家 jb51.cc(jb51.cc) ***/
?>