You are here: Re: back slashes and preg_replace's e modifier « PHP Programming Language « IT news, forums, messages
Re: back slashes and preg_replace's e modifier

Posted by yawnmoth on 11/06/05 01:35

Oli Filth wrote:
> yawnmoth said the following on 05/11/2005 22:29:
> > Can anyone help me understand the following scripts output?:
> >
> > <?
> > echo preg_replace('/.*/e',"sprintf('\\\\\')",'');
> > ?>
>
> I would imagine you have the 2nd and 3rd arguments the wrong way round.

The order of the arguments is actually intentional. I'm trying to
replace the empty string (the third argument) with that which the
second argument would output when ran (as per the e modifier).

The following demonstrates that replacement should be taking place:

<?
echo preg_replace('/.*/','replacement','');
?>

 

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

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