RE: [PHP] Help with output from system() or backticks

2002-08-13 Thread Shawn Sellars

Have you tried it like this?

$output = `$executable $param`;
$output = explode("\n",$output);
print_r($output);

It works for me!  I get the same weird response as you when I try to
create the array directly off of the system call.

Good Luck,
Shawn Sellars

-Original Message-
 Essentially:
$output = array (system("$executable $param"));
print_r($output);


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Help with output from system() or backticks

2002-08-13 Thread David Drewelow

I need to read (and parse) some text-list output from an executable, but 
the output to the PHP script is limited to the first couple of lines.  
Running from the command line works fine, and I get the complete output in 
Perl.

Essentially:
$output = array (system("$executable $param"));
print_r($output);

I've tried various functions (backticks, passthru, etc), and they all seem 
to have the same problem.  I also tried executing the app and piping it to 
a text file, but the text file ends at the same point (after the first 
couple of lines).  I'm wondering whether there is something in the PHP 
interpreter that thinks the app has finished before it has (there's no 
discernable lag-time), or if there's some trick to getting output using 
these functions.

Any help would be appreciated.

Thanks,

-David

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php