University Crest

[wlug] a very simple php question that just has my brain stumped.

 
wlug archive index About the wlug list Mailing lists home
To The University of Waikato HomepageWaikato Home > Waikato Mailing Lists > wlug Info > wlug archives
Matt Brown matt@m...
Wed Mar 12 22:38:11 NZDT 2003


Hi,

Actually exec can give you an array of all of the output from a command

string exec ( string command [, array output [, int return_var]])

so

exec("route", $output);

for ($i=0;$i<count($output);$i++) {
	echo $output[$i] . "<br>";
}

should do the trick.

Regards

On Wed, 12 Mar 2003, kyle carter wrote:

> ok.. php question
> all i want to do is display the output of the route command on a webpage...
> now this is what i thought would be VERY simple in php, however im just not
> thinking about it right im sure.
> nl2br(passthru(route));   i thought would be about all i needed so far i can
> get the results using various methods, however none of them allows me to use
> nl2br to make it display nice on a html page (convert all the \n to <br>).
>
> what SIMPLE thing am i not thinking of.  passthru sends it direct to the
> browser no allowing any manipulation... exec only displays the last line of
> output.
>
> sample ways i have tried all appended into one php script.
>

-- 
Matt Brown
matt@m...




More information about the wlug mailing list
NOTICE: This is an archive of a public mailing list. The University of Waikato is not responsible for its contents.

The University of Waikato - Te Whare Wananga o Waikato