我想超越块值

时间:2015-12-24 09:37:33

标签: php

我想在阻止时获取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;
        }
      }
   }
}

1 个答案:

答案 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;   
 }
}