RE: [PHP] Regular Expressions? Help!

From: Date: Mon, 25 Mar 2002 20:58:56 +0000
Subject: RE: [PHP] Regular Expressions? Help!
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-90100@lists.php.net to get a copy of this message
At 25.03.2002 14:26, you wrote:
Perhaps it is how I am calling the $lines in a while loop.? I have tried $cmd, exec(), exec($cmd, $ouput) (to capture the output as an array), system(), shell_exec(). None of them let me capture the STDOUT from the program. There has to be a way to do this. Anyone? Thanx exec() I just realized why nothing I was trying for the regular expressions wasn't working. The command I am running is a C program on the command line of a Linux box. I can't capture the output, it just gets output onto the screen. I just echo'd $output after the command was run and it was empty. Any ideas? <big snip>
even if think your output must come to $output, an alternative, whenever not so elegant is exec("your_program_name > tmp.file"); the output will be redirected '>' to the file tmp.file. then you can open the file using the known fopen(*) command, and read, processed conventional. HTH Oliver

« previous php.general (#90100) next »