RE: [PHP] storing the passthru() output as an array
| From: | Chris Kay | Date: | Tue, 07 Oct 2003 01:55:40 +0000 |
| Subject: | RE: [PHP] storing the passthru() output as an array | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-165260@lists.php.net to get a copy of this message | ||
I don't know if this is the easiest way but a solution
Pipe ps -ef to a file read the file into an array and do with it what
you will.
EG
$filename = "/tmp/psefdump.txt";
exec("ps -ef > $filename");
$lines = file($filename);
foreach ( $lines as $var ) {
// Yadda Yadda
}
Hope this helps...
--
Chris Kay (CK)
Eleet Internet Services
M: 0415 451 372
P: 02 4620 5076
F: 02 4620 7008
E: chris@eleet.com.au
-----Original Message-----
From: Michael P. Carel [mailto:mikecarel@teamglac.com]
Sent: Tuesday, 7 October 2003 11:41 AM
To: php-general@lists.php.net
Subject: [PHP] storing the passthru() output as an array
Hi again,
Have another problem here I need to get the output of this syntax
$ps = (passthru("ps -ef"));
and store it in an array line by line, I specifically want to get the
Columns of the PID for this command and store it in a selection box .
Any Idea how, thanks in advance.
Mike
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php