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

Posted by Al13n on 10/13/77 11:31

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.

 

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

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