vrana Mon Apr 26 13:43:27 2004 EDT
Modified files:
/phpdoc/en/reference/strings/functions substr-compare.xml
Log:
Initial documentation
http://cvs.php.net/diff.php/phpdoc/en/reference/strings/functions/substr-compare.xml?r1=1.1&r2=1.2&ty=u
Index: phpdoc/en/reference/strings/functions/substr-compare.xml
diff -u phpdoc/en/reference/strings/functions/substr-compare.xml:1.1
phpdoc/en/reference/strings/functions/substr-compare.xml:1.2
--- phpdoc/en/reference/strings/functions/substr-compare.xml:1.1 Sun Nov 2
11:48:28 2003
+++ phpdoc/en/reference/strings/functions/substr-compare.xml Mon Apr 26 13:43:26
2004
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='iso-8859-1'?>
-<!-- $Revision: 1.1 $ -->
+<!-- $Revision: 1.2 $ -->
<refentry id="function.substr-compare">
<refnamediv>
<refname>substr_compare</refname>
@@ -18,7 +18,40 @@
<methodparam
choice="opt"><type>bool</type><parameter>case_sensitivity</parameter></methodparam>
</methodsynopsis>
- &warn.undocumented.func;
+ <para>
+ <function>substr_compare</function> compares <parameter>main_str</parameter>
+ from position <parameter>offset</parameter> with <parameter>str</parameter>
+ up to <parameter>length</parameter> characters.
+ </para>
+ <para>
+ Returns < 0 if <parameter>main_str</parameter> from position
+ <parameter>offset</parameter> is less than <parameter>str</parameter>, >
+ 0 if it is greater than <parameter>str</parameter>, and 0 if they are equal.
+ If <parameter>length</parameter> is equal or greater than length of
+ <parameter>main_str</parameter> and <parameter>length</parameter> is set,
+ <function>substr_compare</function> prints warning and returns &false;.
+ </para>
+ <para>
+ If <parameter>case_sensitivity</parameter> is &true;, comparison is case
+ sensitive.
+ </para>
+ <para>
+ <example>
+ <title>A <function>substr_compare</function> example</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+echo substr_compare("abcde", "bc", 1, 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
+echo substr_compare("abcde", "cd", 1, 2); // -1
+echo substr_compare("abcde", "abc", 5, 1); // warning
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
</refsect1>
</refentry>