Re: Extracting data from exec() call
| From: | Shawn McKenzie | Date: | Tue, 14 Jun 2011 18:55:28 +0000 |
| Subject: | Re: Extracting data from exec() call | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-313526@lists.php.net to get a copy of this message | ||
On 06/14/2011 01:30 PM, Ashley M. Kirchner wrote:
> if ($array = preg_grep('/^ wmax = /', $output)) {
> $array = array_values($array);
> $wmax = explode(', ', $array[0]);
> }
Sorry, didn't have a way to test when I posted. So you've posted two
different expected outputs and I misread the first. You want a string
of only the coma separated numbers? If so:
if ($array = preg_grep('/^ wmax = /', $output)) {
$wmax = array_shift($array);
}
If you want to get rid of the wmax = or add the { } or whatever use
str_replace() and/or concat then on.
--
Thanks!
-Shawn
http://www.spidean.com