How do I make my shell_exec output into pages?
<p>Hi I am new to PHP and hope someone can help me.</p>

<p>Sometimes the output from the executed shell script can be hundreds of lines long, the lines are separated with a <code>&lt;BR&gt;</code> (replaced \n in shell script) for formatted html output.</p>

<p>So I need to know how to make the output paginated, I looked at some other similar solutions here but I couldn't make them work as they did different things.</p>

<pre><code>$url = $_POST["website"];
$safeurl = escapeshellarg($url);
#passthru("./check -n ".$safeurl);
$stuff=shell_exec("./webcheck -n ".$safeurl);

$webFile = ($url.'.txt');
$write = $stuff;
$fh = fopen($webFile, 'w') or die("can't open file");
fwrite($fh, $write);
fclose($fh);

$fh = fopen($webFile, "r") or die("can't open file");
$frstuff=fread($fh, filesize($webFile));
fclose($fh);
echo $frstuff;
</code></pre>
