andrei Mon Mar 12 21:24:40 2001 EDT
Modified files:
/phpdoc/en/functions pcre.xml
Log:
Removed docs for /F modifier, added docs for preg_replace_callback().
Index: phpdoc/en/functions/pcre.xml
diff -u phpdoc/en/functions/pcre.xml:1.46 phpdoc/en/functions/pcre.xml:1.47
--- phpdoc/en/functions/pcre.xml:1.46 Thu Mar 8 02:47:17 2001
+++ phpdoc/en/functions/pcre.xml Mon Mar 12 21:24:39 2001
@@ -373,13 +373,6 @@
the line containing <function>preg_replace</function>.
</para>
<para>
- <literal>/F</literal> modifier means that the
- <parameter>replacement</parameter> is taken to be a function name. This
- function will be called and passed an array of matched elements in the
- subject string. The function should return the replacement string. This
- modifier was added in PHP 4.0.4.
- </para>
- <para>
<example>
<title>Replacing several values</title>
<programlisting>
@@ -457,6 +450,38 @@
</refsect1>
</refentry>
+ <refentry id="function.preg-replace-callback">
+ <refnamediv>
+ <refname>preg_replace_callback</refname>
+ <refpurpose>Perform a regular expression search and replace using a
+callback</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>mixed <function>preg_replace</function></funcdef>
+ <paramdef>mixed <parameter>pattern</parameter></paramdef>
+ <paramdef>mixed <parameter>callback</parameter></paramdef>
+ <paramdef>mixed <parameter>subject</parameter></paramdef>
+ <paramdef>int
+ <parameter><optional>limit</optional></parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ The behavior of this function is almost identical to
+ <function>preg_replace</function>, except for the fact that instead of
+ <parameter>replacement</parameter> parameter, once should specify a
+ <parameter>callback</parameter> that will be called and passed an array of
+ matched elements in the subject string. The callback should return the
+ replacement string. This function was added in PHP 4.0.5.
+ </para>
+ <para>
+ See also <function>preg_replace</function>.
+ </para>
+ </refsect1>
+ </refentry>
+
<refentry id="function.preg-split">
<refnamediv>
<refname>preg_split</refname>
@@ -739,30 +764,11 @@
If this modifier is set, <function>preg_replace</function>
does normal substitution of backreferences in the
replacement string, evaluates it as PHP code, and uses the
- result for replacing the search string. This modifier cannot
- be used along with <literal>/F modifier</literal>.
+ result for replacing the search string.
</simpara>
<simpara>
Only <function>preg_replace</function> uses this modifier;
it is ignored by other PCRE functions.
- </simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><emphasis>F</emphasis></term>
- <listitem>
- <simpara>
- If this modifier is set, <function>preg_replace</function>
- treats the replacement parameter as a function name that
- should be called to provide the replacement string. The
- function is passed an array of matched elements in the
- subject string. This modifier cannot be used along with
- <literal>/e modifier</literal>.
- </simpara>
- <simpara>
- Only <function>preg_replace</function> uses this modifier;
- it is ignored by other PCRE functions. This modifier was
- added in PHP 4.0.4.
</simpara>
</listitem>
</varlistentry>