You are here: Re: ereg_replace « All PHP « IT news, forums, messages
Re: ereg_replace

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация