Re: preg_match fails to resolve variable as a subject

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/27/10 00:57, Richard Quadling wrote:
On 26 November 2010 00:07, Da Rock<php-list@xxxxxxxxxxxxxxxxxxxxxxxxx>  wrote:
preg_match("/(\d{1,3})(\.)$/", exec($mixer . ' ' . $command),&$matches)
Can you ...

var_dump(exec($mixer . ' ' . $command));

I wonder if the output includes a new line which you are not
accounting for in the regex.

Haven't tried yet, but isn't that what $ is for? End of line?

And exec only gives one line- the last line of the output of the command. You have to provide a reference to an array for the entire output.

var_dump gives:
string(41) "Mixer vol is currently set to 75:75"

Any thoughts?

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux