|
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]
|