Re: regexp problem
| From: | Monte Ohrt | Date: | Mon, 09 Oct 2000 13:32:20 +0000 |
| Subject: | Re: regexp problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-19184@lists.php.net to get a copy of this message | ||
Hi Morten,
Try preg_match_all(), that will put each instance of the matching regex
into an array.
// ungreedy, case-insensitive match
preg_match_all("|<select(.+)</select>|Ui",$html,$matches);
// see what is in the output
var_dump($matches);
Morten Johansen wrote:
>
> Hi there,
>
> I'm trying to analyze webpages containing pulldown menus (<select></select>)
>
> So far I've done ok with assuming theres only one pulldown menu on the page,
> but when I'm trying to analyze pages with multiple pulldowns, I get in
> trouble (it only take the first pulldown available)..
> Using eregi("<select(.+)</select>", $htmlcode,$selectcode) now to find the
> code of the pulldown menu.. What I'd like to do is upgrade the script so
> that it find all the pulldowns, was thinking if there was some kind of
> property to ereg that puts all the instances of the regexp into a big
> array...
>
> Please email me someone if you got a suggestion, as I dont check php.general
> often..
>
> Regards,
> Morten Johansen
> morten@pointsol.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net