I want to get the echo value in while block.I am new to php and I have no idea about that.Thank you.
if ($readfile) {
while (FALSE !== ($line = fgets($readfile))) {
if (strpos($line, 'function') !== false) {
echo $line;
while (FALSE !== ($line = fgets($readfile))) {
$lineGroup = array($line);
break;
}
}
}
}
You need to set your $link to equal blank first; this is how your code should look:
$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;
}
}