Fix as per note #106986 and unify format between related functions

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@321383 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Matt Li 2011-12-25 02:27:36 +00:00
parent 0d66a6cf2c
commit 30a6ab9bdf
5 changed files with 52 additions and 40 deletions

View file

@ -3,7 +3,7 @@
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.stripos">
<refnamediv>
<refname>stripos</refname>
<refpurpose>Find position of first occurrence of a case-insensitive string</refpurpose>
<refpurpose>Find the position of the first occurrence of a case-insensitive substring in a string</refpurpose>
</refnamediv>
<refsect1 role="description">
@ -15,12 +15,11 @@
<methodparam choice="opt"><type>int</type><parameter>offset</parameter><initializer>0</initializer></methodparam>
</methodsynopsis>
<para>
Returns the numeric position of the first occurrence of
<parameter>needle</parameter> in the <parameter>haystack</parameter>
<type>string</type>.
Find the numeric position of the last occurrence of
<parameter>needle</parameter> in the <parameter>haystack</parameter> string.
</para>
<para>
Unlike <function>strpos</function>, <function>stripos</function> is
Unlike the <function>strpos</function>, <function>stripos</function> is
case-insensitive.
</para>
</refsect1>
@ -33,7 +32,7 @@
<term><parameter>haystack</parameter></term>
<listitem>
<para>
The string to search in
The string to search in.
</para>
</listitem>
</varlistentry>
@ -54,10 +53,9 @@
<term><parameter>offset</parameter></term>
<listitem>
<para>
The optional <parameter>offset</parameter> parameter allows you
to specify which character in <parameter>haystack</parameter> to
start searching. The position returned is still relative to the
beginning of <parameter>haystack</parameter>.
If specified, search will start this number of characters counted from
the beginning of the string. Unlike <function>strrpos</function> and
<function>strripos</function>, the offset cannot be negative.
</para>
</listitem>
</varlistentry>
@ -68,8 +66,12 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the position as an integer. If <parameter>needle</parameter> is not found,
<function>stripos</function> will return <type>boolean</type> &false;.
Returns the position of where the needle exists relative to the beginnning of
the <parameter>haystack</parameter> string (independent of offset).
Also note that string positions start at 0, and not 1.
</para>
<para>
Returns &false; if the needle was not found.
</para>
&return.falseproblem;
</refsect1>

View file

@ -3,7 +3,7 @@
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.strpos">
<refnamediv>
<refname>strpos</refname>
<refpurpose>Find position of first occurrence of a string</refpurpose>
<refpurpose>Find the position of the first occurrence of a substring in a string</refpurpose>
</refnamediv>
<refsect1 role="description">
@ -15,9 +15,8 @@
<methodparam choice="opt"><type>int</type><parameter>offset</parameter><initializer>0</initializer></methodparam>
</methodsynopsis>
<para>
Returns the numeric position of the first occurrence of
<parameter>needle</parameter> in the <parameter>haystack</parameter>
string.
Find the numeric position of the last occurrence of
<parameter>needle</parameter> in the <parameter>haystack</parameter> string.
</para>
</refsect1>
@ -46,10 +45,9 @@
<term><parameter>offset</parameter></term>
<listitem>
<para>
The optional <parameter>offset</parameter> parameter allows you
to specify which character in <parameter>haystack</parameter> to
start searching. The position returned is still relative to the
beginning of <parameter>haystack</parameter>.
If specified, search will start this number of characters counted from
the beginning of the string. Unlike <function>strrpos</function> and
<function>strripos</function>, the offset cannot be negative.
</para>
</listitem>
</varlistentry>
@ -60,9 +58,12 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the position as an integer. If <parameter>needle</parameter> is
not found, <function>strpos</function> will return <type>boolean</type>
&false;.
Returns the position of where the needle exists relative to the beginnning of
the <parameter>haystack</parameter> string (independent of offset).
Also note that string positions start at 0, and not 1.
</para>
<para>
Returns &false; if the needle was not found.
</para>
&return.falseproblem;
</refsect1>

View file

@ -3,7 +3,7 @@
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.strripos">
<refnamediv>
<refname>strripos</refname>
<refpurpose>Find position of last occurrence of a case-insensitive string in a string</refpurpose>
<refpurpose>Find the position of the last occurrence of a case-insensitive substring in a string</refpurpose>
</refnamediv>
<refsect1 role="description">
@ -15,8 +15,11 @@
<methodparam choice="opt"><type>int</type><parameter>offset</parameter><initializer>0</initializer></methodparam>
</methodsynopsis>
<para>
Find position of last occurrence of a string in a string. Unlike
<function>strrpos</function>, <function>strripos</function> is
Find the numeric position of the last occurrence of
<parameter>needle</parameter> in the <parameter>haystack</parameter> string.
</para>
<para>
Unlike the <function>strrpos</function>, <function>strripos</function> is
case-insensitive.
</para>
</refsect1>
@ -46,9 +49,9 @@
<term><parameter>offset</parameter></term>
<listitem>
<para>
If specified, search will stop this number of characters counted from the
If specified, search will start this number of characters counted from the
beginning of the string. If the value is negative, search will instead start
from that many characters from the end of the string.
from that many characters from the end of the string, searching backwards.
</para>
</listitem>
</varlistentry>
@ -59,12 +62,13 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the numerical position of the last occurrence of
<parameter>needle</parameter>. Also note that string positions start at 0,
and not 1.
Returns the position where the needle exists relative to the beginnning of
the <parameter>haystack</parameter> string (independent of search direction
or offset).
Also note that string positions start at 0, and not 1.
</para>
<para>
If <parameter>needle</parameter> is not found, &false; is returned.
Returns &false; if the needle was not found.
</para>
&return.falseproblem;
</refsect1>

View file

@ -15,9 +15,8 @@
<methodparam choice="opt"><type>int</type><parameter>offset</parameter><initializer>0</initializer></methodparam>
</methodsynopsis>
<para>
Returns the numeric position of the last occurrence of
<parameter>needle</parameter> in the <parameter>haystack</parameter>
string.
Find the numeric position of the last occurrence of
<parameter>needle</parameter> in the <parameter>haystack</parameter> string.
</para>
</refsect1>
@ -46,9 +45,9 @@
<term><parameter>offset</parameter></term>
<listitem>
<para>
If specified, search will stop this number of characters counted from the
If specified, search will start this number of characters counted from the
beginning of the string. If the value is negative, search will instead start
from that many characters from the end of the string.
from that many characters from the end of the string, searching backwards.
</para>
</listitem>
</varlistentry>
@ -59,9 +58,15 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the position where the needle exists. Returns &false; if the needle
was not found.
Returns the position where the needle exists relative to the beginnning of
the <parameter>haystack</parameter> string (independent of search direction
or offset).
Also note that string positions start at 0, and not 1.
</para>
<para>
Returns &false; if the needle was not found.
</para>
&return.falseproblem;
</refsect1>
<refsect1 role="changelog">

View file

@ -3,7 +3,7 @@
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.strstr">
<refnamediv>
<refname>strstr</refname>
<refpurpose>Find first occurrence of a string</refpurpose>
<refpurpose>Find the first occurrence of a string</refpurpose>
</refnamediv>
<refsect1 role="description">