On Sat, 21 Jul 2001 06:32, Tyler Longren wrote:
> $data = exec("host $lookup");
> printf("<pre>%s</pre>", $data);
>
> How can I format the output of that properly?
> Sometimes, it's all on one line, and it's fine.
> Other times, there's more than one line...like if there was an alias.
>
> Any way to format it like it is on the command line?
>
> Thanks,
> Tyler
$data = exec("host $lookup", $ary);
while(list(,$val) = each($ary)) {
echo $val . '<BR>';
}
You need to assign the output of exec to an array if you want to capture
multiple lines of output. Check the manual for more detail.
--
David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA
Try our NEW *SOLAR POWERED* tanning salon!
--
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]