⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 function.preg-last-error.html

📁 php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>Returns the error code of the last PCRE regex execution</title>  <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.preg-grep.html">preg_grep</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.preg-match-all.html">preg_match_all</a></div> <div class="up"><a href="ref.pcre.html">PCRE Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.preg-last-error" class="refentry"> <div class="refnamediv">  <h1 class="refname">preg_last_error</h1>  <p class="verinfo">(PHP 5 &gt;= 5.2.0)</p><p class="refpurpose"><span class="refname">preg_last_error</span> &mdash; <span class="dc-title">Returns the error code of the last PCRE regex execution</span></p> </div> <div class="refsect1 description">  <h3 class="title">Description</h3>  <div class="methodsynopsis dc-description">   <span class="type">int</span> <span class="methodname"><b><b>preg_last_error</b></b></span>    ( <span class="methodparam">void</span>   )</div>  <p class="para rdfs-comment">   Returns the error code of the last PCRE regex execution.  </p>  <p class="para">   <div class="example">    <p><b>Example #1 <b>preg_last_error()</b> example</b></p>    <div class="example-contents"><div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br />preg_match</span><span style="color: #007700">(</span><span style="color: #DD0000">'/(?:\D+|&lt;\d+&gt;)*[!?]/'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'foobar&nbsp;foobar&nbsp;foobar'</span><span style="color: #007700">);<br /><br />if&nbsp;(</span><span style="color: #0000BB">preg_last_error</span><span style="color: #007700">()&nbsp;==&nbsp;</span><span style="color: #0000BB">PREG_BACKTRACK_LIMIT_ERROR</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;</span><span style="color: #DD0000">'Backtrack&nbsp;limit&nbsp;was&nbsp;exhausted!'</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>    </div>    <div class="example-contents"><p>The above example will output:</p></div>    <div class="example-contents"><pre><div class="cdata"><pre>Backtrack limit was exhausted!</pre></div>    </pre></div>   </div>  </p> </div>   <div class="refsect1 returnvalues">  <h3 class="title">Return Values</h3>  <p class="para">   Returns one of the following constants (<a href="pcre.constants.html" class="link">explained on their own page</a>):   <ul class="simplelist">    <li class="member"><b><tt>PREG_NO_ERROR</tt></b></li>    <li class="member"><b><tt>PREG_INTERNAL_ERROR</tt></b></li>    <li class="member"><b><tt>PREG_BACKTRACK_LIMIT_ERROR</tt></b> (see also <a href="pcre.configuration.html#ini.pcre.backtrack-limit" class="link">pcre.backtrack_limit</a>)</li>    <li class="member"><b><tt>PREG_RECURSION_LIMIT_ERROR</tt></b> (see also <a href="pcre.configuration.html#ini.pcre.recursion-limit" class="link">pcre.recursion_limit</a>)</li>    <li class="member"><b><tt>PREG_BAD_UTF8_ERROR</tt></b></li>    <li class="member"><b><tt>PREG_BAD_UTF8_OFFSET_ERROR</tt></b> (since PHP 5.3.0)</li>   </ul>  </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.preg-grep.html">preg_grep</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.preg-match-all.html">preg_match_all</a></div> <div class="up"><a href="ref.pcre.html">PCRE Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -