|
Posted by shaun.demellweek on 10/10/29 11:31
Al13n wrote:
> shaun.demellweek@googlemail.com wrote:
> >
> ><b>I love[/B] php, it is [B]great</b>!
> >
> >How can I change my code to make it appear as
> >
> ><b>I love</b> php, it is <b>great</b>!
> >
> >The code I am using is:
> >
> >$itemtochange =
> >ereg_replace("$from1(.*)$from2","$to1\\1$to2",$itemtochange);
>
> >ereg_replace("$from1(.*?)$from2","$to1\\1$to2",$itemtochange);
>
> --the ? after the * makes it "less greedy" -- it'll stop the first time it
> sees [\b] rather than the last time.
cheers!
Navigation:
[Reply to this message]
|