Web Hosting Talk







View Full Version : Formating PHP Passthru() output


Atomic Haven
03-24-2005, 01:48 PM
I have a my php script running the output of this:


<?php
$output = exec('ping 192.168.5.5');
echo "<pre>$output</pre>";
?>


When I get the output, I get the information I want, but in a messy sort of way. Does anyone know a way to format this info into a cleaner, easier to read format?

Xenatino
03-24-2005, 02:35 PM
You could try using an eregi_replace() or str_replace() on the $output variable before echoing it