> I've been trying to write something to ping a URL on the system level, and
> keep the output in an array. I've been trying to work with system, exec,
> and passthru, but it looks as though they all return only the last line of
> the output. How would I put the whole output into the array? A different
They all *return* the last line, but exec (and some others) accept an array
they can "fill up" with the data you want.
<?php
$cmd = "ping $IP -c 1";
exec($cmd, $results, $error);
while (list(,$line) = each($results)){
echo $line, "<BR>\n";
}
if ($error){
echo "OS Error $error. Usually path/permissions.";
}
?>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]