我想在阻止时获取echo值。我是php新手,我不知道。谢谢。
if ($readfile) {
while (FALSE !== ($line = fgets($readfile))) {
if (strpos($line, 'function') !== false) {
echo $line;
while (FALSE !== ($line = fgets($readfile))) {
$lineGroup = array($line);
break;
}
}
}
}
答案 0 :(得分:0)
您需要先将$ link设置为空白;这就是你的代码看起来的样子:
$line ="";
if ($readfile) {
while (FALSE !== ($line = fgets($readfile))) {
if (strpos($line, 'function') !== false) {
$line .=$line;
while (FALSE !== ($line = fgets($readfile))) {
$lineGroup = array($line);
break;
}
}
echo $line;
}
}