mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Add example
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@247676 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
343ecac338
commit
cdaad7fc5e
1 changed files with 26 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<refentry xml:id="function.preg-last-error" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>preg_last_error</refname>
|
||||
|
@ -15,8 +15,32 @@
|
|||
<para>
|
||||
Returns the error code of the last PCRE regex execution.
|
||||
</para>
|
||||
</refsect1>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>preg_last_error</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
preg_match('/(?:\D+|<\d+>)*[!?]/', 'foobar foobar foobar');
|
||||
|
||||
if (preg_last_error() == PREG_BACKTRACK_LIMIT_ERROR) {
|
||||
print 'Backtrack limit was exhausted!';
|
||||
}
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Backtrack limit was exhausted!
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
|
|
Loading…
Reference in a new issue