mention that the offset can be negative

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@242056 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Nuno Lopes 2007-09-01 18:57:54 +00:00
parent 3f1468766e
commit efab4bb920

View file

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.6 $ -->
<!-- $Revision: 1.7 $ -->
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.substr-compare">
<refnamediv>
<refname>substr_compare</refname>
@ -45,7 +45,8 @@
<term><parameter>offset</parameter></term>
<listitem>
<para>
The start position for the comparison.
The start position for the comparison. If negative, it starts counting
from the end of the string.
</para>
</listitem>
</varlistentry>
@ -82,6 +83,30 @@
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>5.1.0</entry>
<entry>
Added the possibility to use a negative <parameter>offset</parameter>.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
@ -91,6 +116,7 @@
<![CDATA[
<?php
echo substr_compare("abcde", "bc", 1, 2); // 0
echo substr_compare("abcde", "de", -2, 2); // 0
echo substr_compare("abcde", "bcg", 1, 2); // 0
echo substr_compare("abcde", "BC", 1, 2, true); // 0
echo substr_compare("abcde", "bc", 1, 3); // 1