Re: Maximum Execution Time and pereg_replace
| From: | Brent Charbonneau | Date: | Wed, 18 Oct 2000 23:59:20 +0000 |
| Subject: | Re: Maximum Execution Time and pereg_replace | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-21016@lists.php.net to get a copy of this message | ||
"Daniel Convissor" <danielc@analysisandsolutions.com> wrote in message
news:39EDD87F.6A8C399C@analysisandsolutions.com...
> Hey Brent:
>
> One solution may be to drop the reassignment of $this->raw_modify_style to
> $out_text. Just keep manipulating $this->raw_modify_style. Something
like:
>
> $this->raw_modify_style = ereg_replace("<!\\-\\-#title#\\-\\->",
> "$title", "$this->raw_modify_style");
>
> and continue the process like that...
That would be fine in this case, but the problem I described also occurs
when outputing the actual news articles, and in that situation the
raw_modify_style will need to be kept, because the style file only defines 1
instance of an article, and the tag replacement will need to be done again
and again.
>
> Another possiblity is to increase the memory limits set in your php.ini
file.
>
This is also somehting that I'm not exactly willing to do. This is a script
for others to use, and I don't want to have to require something odd like
that just for (what should be) a simple news script.
>
> > $out_text =
> > preg_replace("/<!--#MODIFY#-->((.|\\n|\\r)*)?<!--#\/MODIFY#-->/",
> > ($step
==
> > 3)?"\\1" : "", $out_text);
>
> Uh, maybe this wild guess will work better too...
>
> if ($step == 3) {
> $this->raw_modify_style =
> preg_replace("/<!--#MODIFY#-->((.|\\n|\\r)*)?<!--#\/MODIFY#-->/",
> "\\1", "$this->raw_modify_style");
> }
thanks for the suggestion, but if step != 3 I actually want the stuff in
between the tags to disappear (which is why it's done the way I did it).
Any other thoughts?
-brent
--
Brent Charbonneau
--
inertianews@brentc.com | www.brentc.com/inertianews