Reply to Re: preg_replace

Your name:

Reply:


Posted by Philip Ronan on 10/29/54 11:33

"Raj" wrote:

> "Philip Ronan" <invalid@invalid.invalid> wrote in message
> news:BFB37AB7.3BC85%invalid@invalid.invalid...
>>
>> Try $values['\1'] instead of $values[\\1]. Looks OK otherwise.
>
> Thanks Phil, however it still does not do the replacement. Is there an easy
> way I can print the value of the match? and does the replace function
> substitue greedily? i.e. will it replace all three placeholders on on line?

I just noticed you're also using unquoted text in the $values declarations.

Change $values[pic1] to $values['pic1'], etc. You should also put this line
at the beginning of your script:

error_reporting(E_ALL);

That will help you find any other mistakes. You don't need to worry about
greedy matches because \S will stop matching at the first space character.

--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/

[Back to original 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

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