Just wondering if you can help me out a bit with a little task I'm trying to do in php.
I have text that looks something like this in a file:
(random html)
...
<OPTION VALUE="195" SELECTED>Physical Chem
<OPTION VALUE="239">Physical Chem Lab II
<OPTION VALUE="555">Physical Chem for Engineers
...
(random html)
I want to return the # value of the option values ignoring everything else. For example, in the above case I would want 195, 239 & 555 returned, nothing else like "Option Value=".
I am having trouble doing this in PHP. So far I have this:
preg_match("/OPTION VALUE=\"([0-9]*)/", $data, $matches);
print_r($matches);
With the return value of this:
Array ( [0] => OPTION VALUE="195[1] => 195) Array ( [0] => OPTION VALUE="195[1] => 195)
How can I return the all the #'s?
I'm a newbie at pattern matching and tutorials I've read haven't helped much, so thanks a ton!