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" <[EMAIL PROTECTED]> wrote in message
B120D7EC8868D411A63D0050040EDA771118F3@XCHANGE">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:[EMAIL PROTECTED]
> http://www.fh-augsburg.de/~kiko
> ICQ: 100601600
> -----



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to