Re: ereg
| From: | lallous | Date: | Tue, 27 Nov 2001 14:23:08 +0000 |
| Subject: | Re: ereg | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-75782@lists.php.net to get a copy of this message | ||
I'm not sure if the ereg supports the inline greedy modifier like:
.+? or .*?
so:
ereg("<\?php.*?\?\>", $html, $phpIncludes);
if not use preg_match() instead...
"Christoph Starkmann" <kiko@nfq.de> wrote in message
news:B120D7EC8868D411A63D0050040EDA771118F3@XCHANGE...
> As far as I can say, a simple ereg-command is always greedy, isn't it?
> Can you tell me how to switch greedy off?
>
> I want to find everything between the start- and end-php-tags:
>
> $phpIncludes = array();
> ereg("<\?php.*\?\>", $html, $phpIncludes);
>
> where $html contains the entire page, containing one php-script-section
> at the very top and one at the very botton, and maybe some inbetween.
>
> Now the above ereg always returns me the entire site in $phpIncludes[0];
>
> All help is appreciated, thanx a lot,
>
> cheers,
>
> Kiko
>
> -----
> It's not a bug, it's a feature.
> christoph starkmann
> mailto:kiko@nfq.de
> http://www.fh-augsburg.de/~kiko
> ICQ: 100601600
> -----