Skip to content

Commit 95d0554

Browse files
authored
mb-strpos.xml Use parameter names instead of types, fix typos and XML syntax (php#4964)
1 parent 876557a commit 95d0554

File tree

9 files changed

+29
-43
lines changed

9 files changed

+29
-43
lines changed

reference/mbstring/functions/mb-stripos.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,7 @@
5858
<varlistentry>
5959
<term><parameter>encoding</parameter></term>
6060
<listitem>
61-
<para>
62-
Character encoding name to use.
63-
If it is omitted, internal character encoding is used.
64-
</para>
61+
&mbstring.encoding.parameter;
6562
</listitem>
6663
</varlistentry>
6764
</variablelist>

reference/mbstring/functions/mb-stristr.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,7 @@
6161
<varlistentry>
6262
<term><parameter>encoding</parameter></term>
6363
<listitem>
64-
<para>
65-
Character encoding name to use.
66-
If it is omitted, internal character encoding is used.
67-
</para>
64+
&mbstring.encoding.parameter;
6865
</listitem>
6966
</varlistentry>
7067
</variablelist>

reference/mbstring/functions/mb-strpos.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>encoding</parameter><initializer>&null;</initializer></methodparam>
1717
</methodsynopsis>
1818
<para>
19-
Finds position of the first occurrence of a <type>string</type> in a <type>string</type>.
19+
Finds position of the first occurrence of <parameter>needle</parameter> in the <parameter>haystack</parameter> string.
2020
</para>
2121
<para>
2222
Performs a multi-byte safe
@@ -34,7 +34,8 @@
3434
<term><parameter>haystack</parameter></term>
3535
<listitem>
3636
<para>
37-
The <type>string</type> being checked.
37+
The string from which to get the position of the first occurrence
38+
of <parameter>needle</parameter>.
3839
</para>
3940
</listitem>
4041
</varlistentry>

reference/mbstring/functions/mb-strrchr.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,7 @@
5959
<varlistentry>
6060
<term><parameter>encoding</parameter></term>
6161
<listitem>
62-
<para>
63-
Character encoding name to use.
64-
If it is omitted, internal character encoding is used.
65-
</para>
62+
&mbstring.encoding.parameter;
6663
</listitem>
6764
</varlistentry>
6865
</variablelist>

reference/mbstring/functions/mb-strrichr.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,7 @@
6161
<varlistentry>
6262
<term><parameter>encoding</parameter></term>
6363
<listitem>
64-
<para>
65-
Character encoding name to use.
66-
If it is omitted, internal character encoding is used.
67-
</para>
64+
&mbstring.encoding.parameter;
6865
</listitem>
6966
</varlistentry>
7067
</variablelist>

reference/mbstring/functions/mb-strripos.xml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,34 +35,32 @@
3535
<listitem>
3636
<para>
3737
The string from which to get the position of the last occurrence
38-
of <parameter>needle</parameter>
38+
of <parameter>needle</parameter>.
3939
</para>
4040
</listitem>
4141
</varlistentry>
4242
<varlistentry>
4343
<term><parameter>needle</parameter></term>
4444
<listitem>
4545
<para>
46-
The string to find in <parameter>haystack</parameter>
46+
The string to find in <parameter>haystack</parameter>.
4747
</para>
4848
</listitem>
4949
</varlistentry>
5050
<varlistentry>
5151
<term><parameter>offset</parameter></term>
5252
<listitem>
5353
<para>
54-
The position in <parameter>haystack</parameter>
55-
to start searching
54+
May be specified to begin searching an arbitrary number of characters into
55+
the <parameter>haystack</parameter>. Negative values will stop searching at an arbitrary point
56+
prior to the end of the <parameter>haystack</parameter>.
5657
</para>
5758
</listitem>
5859
</varlistentry>
5960
<varlistentry>
6061
<term><parameter>encoding</parameter></term>
6162
<listitem>
62-
<para>
63-
Character encoding name to use.
64-
If it is omitted, internal character encoding is used.
65-
</para>
63+
&mbstring.encoding.parameter;
6664
</listitem>
6765
</varlistentry>
6866
</variablelist>

reference/mbstring/functions/mb-strrpos.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
<listitem>
5252
<simpara>
5353
May be specified to begin searching an arbitrary number of characters into
54-
the <type>string</type>. Negative values will stop searching at an arbitrary point
55-
prior to the end of the <type>string</type>.
54+
the <parameter>haystack</parameter>. Negative values will stop searching at an arbitrary point
55+
prior to the end of the <parameter>haystack</parameter>.
5656
</simpara>
5757
</listitem>
5858
</varlistentry>
@@ -105,7 +105,7 @@
105105
<entry>8.0.0</entry>
106106
<entry>
107107
Passing the <parameter>encoding</parameter> as the third argument
108-
instead of an offset has been removed.
108+
instead of an <parameter>offset</parameter> has been removed.
109109
</entry>
110110
</row>
111111
&mbstring.changelog.encoding-nullable;

reference/mbstring/functions/mb-strstr.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,7 @@
5959
<varlistentry>
6060
<term><parameter>encoding</parameter></term>
6161
<listitem>
62-
<para>
63-
Character encoding name to use.
64-
If it is omitted, internal character encoding is used.
65-
</para>
62+
&mbstring.encoding.parameter;
6663
</listitem>
6764
</varlistentry>
6865
</variablelist>

reference/strings/functions/strripos.xml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<refname>strripos</refname>
66
<refpurpose>Find the position of the last occurrence of a case-insensitive substring in a string</refpurpose>
77
</refnamediv>
8-
8+
99
<refsect1 role="description">
1010
&reftitle.description;
1111
<methodsynopsis>
@@ -18,7 +18,7 @@
1818
Find the numeric position of the last occurrence of
1919
<parameter>needle</parameter> in the <parameter>haystack</parameter> string.
2020
</para>
21-
<para>
21+
<para>
2222
Unlike the <function>strrpos</function>, <function>strripos</function> is
2323
case-insensitive.
2424
</para>
@@ -48,7 +48,7 @@
4848
<varlistentry>
4949
<term><parameter>offset</parameter></term>
5050
<listitem>
51-
<para>
51+
<para>
5252
If zero or positive, the search is performed left to right skipping the
5353
first <parameter>offset</parameter> bytes of the
5454
<parameter>haystack</parameter>.
@@ -75,17 +75,17 @@
7575
<refsect1 role="returnvalues">
7676
&reftitle.returnvalues;
7777
<para>
78-
Returns the position where the needle exists relative to the beginnning of
78+
Returns the position where the <parameter>needle</parameter> exists relative to the beginning of
7979
the <parameter>haystack</parameter> string (independent of search direction
80-
or offset).
80+
or <parameter>offset</parameter>).
8181
<note>
8282
<simpara>
8383
String positions start at 0, and not 1.
8484
</simpara>
8585
</note>
8686
</para>
8787
<para>
88-
Returns &false; if the needle was not found.
88+
Returns &false; if the <parameter>needle</parameter> was not found.
8989
</para>
9090
&return.falseproblem;
9191
</refsect1>
@@ -141,25 +141,27 @@
141141
<programlisting role="php">
142142
<![CDATA[
143143
<?php
144+
144145
$haystack = 'ababcd';
145146
$needle = 'aB';
146147
147148
$pos = strripos($haystack, $needle);
148149
149150
if ($pos === false) {
150-
echo "Sorry, we did not find ($needle) in ($haystack)";
151+
echo "Sorry, we did not find `$needle` in `$haystack`";
151152
} else {
152153
echo "Congratulations!\n";
153-
echo "We found the last ($needle) in ($haystack) at position ($pos)";
154+
echo "We found the last `$needle` in `$haystack` at position `$pos`";
154155
}
156+
155157
?>
156158
]]>
157159
</programlisting>
158160
&example.outputs;
159161
<screen>
160162
<![CDATA[
161-
Congratulations!
162-
We found the last (aB) in (ababcd) at position (2)
163+
Congratulations!
164+
We found the last `aB` in `ababcd` at position `2`
163165
]]>
164166
</screen>
165167
</example>

0 commit comments

Comments
 (0)