How can i store into a string ALL of the data returned by a system command?
Thnaks
fLIPIS
Use the backtick: "`". As in
$allofit=ls;
ls
No, i meant, how can i store the RESULT of a system operation into a string?
I use Win32 with apache and PHP 4.0.6
Say i want to do like:
ping 123.456.789.012
and store the result of the ping command on a string.
How could i do that?
Thanks
Well, I dunno about Windows (would never consider using it for a server) but on linux it does exactly what you are asking about.
See http://www.php.net/manual/en/language.operators.execution.php
This code:
$ping_reply=ping www.host.com; $sql="insert into pingtable (pingreply) values ('$ping_reply')"; pg_exec($sql);
ping www.host.com
would do exactly what you think it should do. Remember, it's the "backtick", the button on the top left that also has the tilde on it: ~
-Ben
Wow. Thanks. Just what i wanted.