cvs: phpdoc /en/reference/pcre/functions preg-replace.xml
| From: | Nuno Lopes | Date: | Sun, 11 Feb 2007 19:48:34 +0000 |
| Subject: | cvs: phpdoc /en/reference/pcre/functions preg-replace.xml | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969375437@lists.php.net to get a copy of this message | ||
nlopess Sun Feb 11 19:48:34 2007 UTC
Modified files:
/phpdoc/en/reference/pcre/functions preg-replace.xml
Log:
fix bug #40395: document which chars are escaped when running with '/e' modifier
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/pcre/functions/preg-replace.xml?r1=1.22&r2=1.23&diff_format=u
Index: phpdoc/en/reference/pcre/functions/preg-replace.xml
diff -u phpdoc/en/reference/pcre/functions/preg-replace.xml:1.22
phpdoc/en/reference/pcre/functions/preg-replace.xml:1.23
--- phpdoc/en/reference/pcre/functions/preg-replace.xml:1.22 Fri Feb 2 22:44:17 2007
+++ phpdoc/en/reference/pcre/functions/preg-replace.xml Sun Feb 11 19:48:34 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.22 $ -->
+<!-- $Revision: 1.23 $ -->
<refentry id="function.preg-replace">
<refnamediv>
<refname>preg_replace</refname>
@@ -83,6 +83,17 @@
<literal>$1</literal> backreference, leaving the
<literal>1</literal>
as a literal.
</para>
+ <para>
+ When using the <literal>e</literal> modifier, this function escapes
+ some characters (namely <literal>'</literal>,
<literal>"</literal>,
+ <literal>\</literal> and NULL) in the strings that replace the
+ backreferences. This is done to ensure that no syntax errors arrise
+ from backreference usage with either single or double quotes (e.g.
+ <literal>'strlen(\'$1\')+strlen("$2")'</literal>).
Make sure you are
+ aware of PHP's <link linkend="language.types.string">string
+ syntax</link> to know exactly how the interpreted string will look
+ like.
+ </para>
</listitem>
</varlistentry>
<varlistentry>