<?php include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc'; $TOC = array(); $TOC_DEPRECATED = array(); $PARENTS = array(); include_once dirname(__FILE__) ."/toc/ref.mbstring.inc"; $setup = array ( 'home' => array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.mb-ereg-search-pos.php', 1 => 'mb_ereg_search_pos', 2 => 'Returns position and length of a matched part of the multibyte regular expression for a predefined multibyte string', ), 'up' => array ( 0 => 'ref.mbstring.php', 1 => '多字节字符串 函数', ), 'prev' => array ( 0 => 'function.mb-ereg-search-init.php', 1 => 'mb_ereg_search_init', ), 'next' => array ( 0 => 'function.mb-ereg-search-regs.php', 1 => 'mb_ereg_search_regs', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/mbstring/functions/mb-ereg-search-pos.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?> <div id="function.mb-ereg-search-pos" class="refentry"> <div class="refnamediv"> <h1 class="refname">mb_ereg_search_pos</h1> <p class="verinfo">(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">mb_ereg_search_pos</span> — <span class="dc-title">Returns position and length of a matched part of the multibyte regular expression for a predefined multibyte string</span></p> </div> <div class="refsect1 description" id="refsect1-function.mb-ereg-search-pos-description"> <h3 class="title">说明</h3> <div class="methodsynopsis dc-description"> <span class="methodname"><strong>mb_ereg_search_pos</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$pattern</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$options</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><span class="type"><a href="language.types.array.php" class="type array">array</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div> <p class="para rdfs-comment"> Returns position and length of a matched part of the multibyte regular expression for a predefined multibyte string </p> <p class="para"> The string for match is specified by <span class="function"><a href="function.mb-ereg-search-init.php" class="function">mb_ereg_search_init()</a></span>. If it is not specified, the previous one will be used. </p> </div> <div class="refsect1 parameters" id="refsect1-function.mb-ereg-search-pos-parameters"> <h3 class="title">参数</h3> <p class="para"> <dl> <dt><code class="parameter">pattern</code></dt> <dd> <p class="para"> The search pattern. </p> </dd> <dt><code class="parameter">options</code></dt> <dd> <p class="para"> The search option. See <span class="function"><a href="function.mb-regex-set-options.php" class="function">mb_regex_set_options()</a></span> for explanation. </p> </dd> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-function.mb-ereg-search-pos-returnvalues"> <h3 class="title">返回值</h3> <p class="simpara"> An <span class="type"><a href="language.types.array.php" class="type array">array</a></span> containing two elements. The first element is the offset, in bytes, where the match begins relative to the start of the search string, and the second element is the length in bytes of the match. </p> <p class="simpara"> If an error occurs, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> is returned. </p> </div> <div class="refsect1 changelog" id="refsect1-function.mb-ereg-search-pos-changelog"> <h3 class="title">更新日志</h3> <p class="para"> <table class="doctable informaltable"> <thead> <tr> <th>版本</th> <th>说明</th> </tr> </thead> <tbody class="tbody"> <tr> <td>8.0.0</td> <td> <code class="parameter">pattern</code> and <code class="parameter">options</code> are nullable now. </td> </tr> </tbody> </table> </p> </div> <div class="refsect1 notes" id="refsect1-function.mb-ereg-search-pos-notes"> <h3 class="title">注释</h3> <blockquote class="note"><p><strong class="note">注意</strong>: <p class="para"><span class="function"><a href="function.mb-regex-encoding.php" class="function">mb_regex_encoding()</a></span> 指定的内部编码或字符编码将会当作此函数用的字符编码。</p></p></blockquote> </div> <div class="refsect1 seealso" id="refsect1-function.mb-ereg-search-pos-seealso"> <h3 class="title">参见</h3> <p class="para"> <ul class="simplelist"> <li><span class="function"><a href="function.mb-regex-encoding.php" class="function" rel="rdfs-seeAlso">mb_regex_encoding()</a> - Set/Get character encoding for multibyte regex</span></li> <li><span class="function"><a href="function.mb-ereg-search-init.php" class="function" rel="rdfs-seeAlso">mb_ereg_search_init()</a> - Setup string and regular expression for a multibyte regular expression match</span></li> </ul> </p> </div> </div><?php manual_footer($setup); ?>