reference/strings/functions/stripos.xml
71b1e926631d5f5bec9b2e2685553453349ae799
...
...
@@ -1,6 +1,6 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.stripos">
3
+
<refentry xml:id="function.stripos" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>stripos</refname>
6
6
<refpurpose>Find the position of the first occurrence of a case-insensitive substring in a string</refpurpose>
...
...
@@ -9,7 +9,7 @@
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>mixed</type><methodname>stripos</methodname>
12
+
<type class="union"><type>int</type><type>false</type></type><methodname>stripos</methodname>
13
13
<methodparam><type>string</type><parameter>haystack</parameter></methodparam>
14
14
<methodparam><type>string</type><parameter>needle</parameter></methodparam>
15
15
<methodparam choice="opt"><type>int</type><parameter>offset</parameter><initializer>0</initializer></methodparam>
...
...
@@ -40,13 +40,9 @@
40
40
<term><parameter>needle</parameter></term>
41
41
<listitem>
42
42
<para>
43
-
Note that the <parameter>needle</parameter> may be a string of one or
44
-
more characters.
45
-
</para>
46
-
<para>
47
-
If <parameter>needle</parameter> is not a string, it is converted to
48
-
an integer and applied as the ordinal value of a character.
43
+
The string to search for.
49
44
</para>
45
+
&strings.parameter.needle.non-string;
50
46
</listitem>
51
47
</varlistentry>
52
48
<varlistentry>
...
...
@@ -54,8 +50,8 @@
54
50
<listitem>
55
51
<para>
56
52
If specified, search will start this number of characters counted from
57
-
the beginning of the string. Unlike <function>strrpos</function> and
58
-
<function>strripos</function>, the offset cannot be negative.
53
+
the beginning of the string. If the offset is negative, the search will start
54
+
this number of characters counted from the end of the string.
59
55
</para>
60
56
</listitem>
61
57
</varlistentry>
...
...
@@ -66,7 +62,7 @@
66
62
<refsect1 role="returnvalues">
67
63
&reftitle.returnvalues;
68
64
<para>
69
-
Returns the position of where the needle exists relative to the beginnning of
65
+
Returns the position of where the needle exists relative to the beginning of
70
66
the <parameter>haystack</parameter> string (independent of offset).
71
67
Also note that string positions start at 0, and not 1.
72
68
</para>
...
...
@@ -76,6 +72,42 @@
76
72
&return.falseproblem;
77
73
</refsect1>
78
74

75
+
<refsect1 role="changelog">
76
+
&reftitle.changelog;
77
+
<informaltable>
78
+
<tgroup cols="2">
79
+
<thead>
80
+
<row>
81
+
<entry>&Version;</entry>
82
+
<entry>&Description;</entry>
83
+
</row>
84
+
</thead>
85
+
<tbody>
86
+
&strings.changelog.ascii-case-folding;
87
+
&strings.changelog.needle-empty;
88
+
<row>
89
+
<entry>8.0.0</entry>
90
+
<entry>
91
+
Passing an &integer; as <parameter>needle</parameter> is no longer supported.
92
+
</entry>
93
+
</row>
94
+
<row>
95
+
<entry>7.3.0</entry>
96
+
<entry>
97
+
Passing an &integer; as <parameter>needle</parameter> has been deprecated.
98
+
</entry>
99
+
</row>
100
+
<row>
101
+
<entry>7.1.0</entry>
102
+
<entry>
103
+
Support for negative <parameter>offset</parameter>s has been added.
104
+
</entry>
105
+
</row>
106
+
</tbody>
107
+
</tgroup>
108
+
</informaltable>
109
+
</refsect1>
110
+

79
111
<refsect1 role="examples">
80
112
&reftitle.examples;
81
113
<para>
...
...
@@ -118,6 +150,9 @@ if ($pos2 !== false) {
118
150
<para>
119
151
<simplelist>
120
152
<member><function>mb_stripos</function></member>
153
+
<member><function>str_contains</function></member>
154
+
<member><function>str_ends_with</function></member>
155
+
<member><function>str_starts_with</function></member>
121
156
<member><function>strpos</function></member>
122
157
<member><function>strrpos</function></member>
123
158
<member><function>strripos</function></member>
...
...
@@ -129,7 +164,6 @@ if ($pos2 !== false) {
129
164
</refsect1>
130
165

131
166
</refentry>
132
-

133
167
<!-- Keep this comment at the end of the file
134
168
Local variables:
135
169
mode: sgml
136
170