$filename = 'log';
$handle = fopen($filename, 'r');
while(!feof($handle)) {
$buffer = fgets($handle, 4096);
$text = trim($buffer);
if(strpos($text, '@sina')) {
echo $text;
}
}
fclose($handle);
$filename = 'log';
$handle = fopen($filename, 'r');
while(!feof($handle)) {
$buffer = fgets($handle, 4096);
$text = trim($buffer);
if(strpos($text, '@sina')) {
echo $text;
}
}
fclose($handle);
本文标题:PHP逐行读取匹配内容
本文链接:https://www.haomeiwen.com/subject/hlpqtqtx.html
网友评论