nlopess Sat Sep 1 18:57:54 2007 UTC
Modified files:
/phpdoc/en/reference/strings/functions substr-compare.xml
Log:
mention that the offset can be negative
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/strings/functions/substr-compare.xml?r1=1.6&r2=1.7&diff_format=u
Index: phpdoc/en/reference/strings/functions/substr-compare.xml
diff -u phpdoc/en/reference/strings/functions/substr-compare.xml:1.6
phpdoc/en/reference/strings/functions/substr-compare.xml:1.7
--- phpdoc/en/reference/strings/functions/substr-compare.xml:1.6 Wed Jun
20 22:25:31 2007
+++ phpdoc/en/reference/strings/functions/substr-compare.xml Sat Sep 1
18:57:54 2007
@@ -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