Re: [PHP] Help With passthru, system, exec

2001-01-21 Thread Richard Lynch

> 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.

\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]




[PHP] Help With passthru, system, exec

2001-01-21 Thread Pete Lavetsky

Hi Everyone,

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
function, or possible it was with backtics, though I couldn't find any
examples that did this.  Any help would be appreciated.

if($IP)
{
   $systemstring=escapeshellcmd("ping $IP -c 1");
   $array = passthru("$systemstring",$returnvalue);
   echo $array;  -->  This outputs only the last line
}

Thanks,
Pete


-- 
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]