<?php
$end_str = '';
$fp = fopen($filename, 'r');
while (!feof($fp)) {
$data = fread($fp, 4096);
if ($end_str) {
$data = $end_str.$data;
}
$datas = explode("\n", trim($data));
if (substr($data, -1) == "\n" || substr($data, -1) == "\r") {
$end_str = '';
} else {
$end_str = trim(array_pop($datas));
}
foreach ($datas as $value) {
$line= trim($value);
}
}
fclose($fp);
标签:none