com doc/zh: 更新 preg_replace_callback( ) 的参数 Close php/doc-zh#13 : reference/pcre/functions/preg-replace-callback.xml
[email protected] (Dai Jie) Tue, 02 Feb 2021 08:43:30 +0000
| Newsgroups | php.doc.zh |
|---|---|
| Message-ID | <[email protected]> |
Commit: 5b7740d0abfa426501b863f2db3badd2ba8dcebc Author: jwj <[email protected]> Tue, 2 Feb 2021 16:11:56 +0800 Committer: daijie <[email protected]> Tue, 2 Feb 2021 16:43:30 +0800 Parents: 9279b397d4a2548c5e9f9dc50c174845bed8d7d2 Branches: master Link: http://git.php.net/?p=doc/zh.git;a=commitdiff;h=5b7740d0abfa426501b863f2db3badd2ba8dcebc Log: 更新 preg_replace_callback() 的参数 Close php/doc-zh#13 Bugs: https://bugs.php.net/13 Changed paths: M reference/pcre/functions/preg-replace-callback.xml Diff: diff --git a/reference/pcre/functions/preg-replace-callback.xml b/reference/pcre/functions/preg-replace-callback.xml index 533c2a9b..1f9f6ff1 100644 --- a/reference/pcre/functions/preg-replace-callback.xml +++ b/reference/pcre/functions/preg-replace-callback.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <!-- $Revision$ --> <!-- $Author$ --> -<!-- EN-Revision: 80872147aa52367137bd3d168412f70cbe2ddf9c Maintainer: daijie Status: ready --> +<!-- EN-Revision: 22e850b66cd9a4b8f0e002bd5850f9839caaf152 Maintainer: daijie Status: ready --> <refentry xml:id="function.preg-replace-callback" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>preg_replace_callback</refname> @@ -11,12 +11,13 @@ <refsect1 role="description"> &reftitle.description; <methodsynopsis> - <type>mixed</type><methodname>preg_replace_callback</methodname> - <methodparam><type>mixed</type><parameter>pattern</parameter></methodparam> + <type class="union"><type>string</type><type>array</type><type>null</type></type><methodname>preg_replace_callback</methodname> + <methodparam><type class="union"><type>string</type><type>array</type></type><parameter>pattern</parameter></methodparam> <methodparam><type>callable</type><parameter>callback</parameter></methodparam> - <methodparam><type>mixed</type><parameter>subject</parameter></methodparam> + <methodparam><type class="union"><type>string</type><type>array</type></type><parameter>subject</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>limit</parameter><initializer>-1</initializer></methodparam> - <methodparam choice="opt"><type>int</type><parameter role="reference">count</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter role="reference">count</parameter><initializer>&null;</initializer></methodparam> + <methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer>0</initializer></methodparam> </methodsynopsis> <para> 这个函数的行为除了可以指定一个 @@ -61,7 +62,7 @@ </para> <para> <example> - <title><function>preg_replace_callback</function> 和 + <title><function>preg_replace_callback</function> 和 匿名函数</title> <programlisting role="php"> <![CDATA[ @@ -108,7 +109,17 @@ fclose($fp); <term><parameter>count</parameter></term> <listitem> <para> - 如果指定,这个变量将被填充为替换执行的次数。 + 如果指定,这个变量将被填充为替换执行的次数。 + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>flags</parameter></term> + <listitem> + <para> + <parameter>flags</parameter> 可以是 <constant>PREG_OFFSET_CAPTURE</constant> + 和 <constant>PREG_UNMATCHED_AS_NULL</constant> 标志的组合, 这会影响匹配到的结果的格式。 + 相关详情请参阅 <function>preg_match</function> 中的描述。 </para> </listitem> </varlistentry> @@ -243,7 +254,6 @@ echo $output; </refsect1> </refentry> - <!-- Keep this comment at the end of the file Local variables: mode: sgml