mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Initial documentation
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@157185 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
5a9a466dfd
commit
c833bbde62
1 changed files with 35 additions and 2 deletions
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue