reference/iconv/functions/iconv-substr.xml
ab9a7d2e3dfa9224186abcbd7a43b3af08d1bfdb
...
...
@@ -9,14 +9,14 @@
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>string</type><methodname>iconv_substr</methodname>
13
-
<methodparam><type>string</type><parameter>str</parameter></methodparam>
12
+
<type class="union"><type>string</type><type>false</type></type><methodname>iconv_substr</methodname>
13
+
<methodparam><type>string</type><parameter>string</parameter></methodparam>
14
14
<methodparam><type>int</type><parameter>offset</parameter></methodparam>
15
-
<methodparam choice="opt"><type>int</type><parameter>length</parameter><initializer>iconv_strlen($str, $charset)</initializer></methodparam>
16
-
<methodparam choice="opt"><type>string</type><parameter>charset</parameter><initializer>ini_get("iconv.internal_encoding")</initializer></methodparam>
15
+
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>length</parameter><initializer>&null;</initializer></methodparam>
16
+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>encoding</parameter><initializer>&null;</initializer></methodparam>
17
17
</methodsynopsis>
18
18
<para>
19
-
Cuts a portion of <parameter>str</parameter> specified by the
19
+
Cuts a portion of <parameter>string</parameter> specified by the
20
20
<parameter>offset</parameter> and <parameter>length</parameter> parameters.
21
21
</para>
22
22
</refsect1>
...
...
@@ -26,7 +26,7 @@
26
26
<para>
27
27
<variablelist>
28
28
<varlistentry>
29
-
<term><parameter>str</parameter></term>
29
+
<term><parameter>string</parameter></term>
30
30
<listitem>
31
31
<para>
32
32
The original string.
...
...
@@ -39,14 +39,14 @@
39
39
<para>
40
40
If <parameter>offset</parameter> is non-negative,
41
41
<function>iconv_substr</function> cuts the portion out of
42
-
<parameter>str</parameter> beginning at <parameter>offset</parameter>'th
42
+
<parameter>string</parameter> beginning at <parameter>offset</parameter>'th
43
43
character, counting from zero.
44
44
</para>
45
45
<para>
46
46
If <parameter>offset</parameter> is negative,
47
47
<function>iconv_substr</function> cuts out the portion beginning
48
48
at the position, <parameter>offset</parameter> characters
49
-
away from the end of <parameter>str</parameter>.
49
+
away from the end of <parameter>string</parameter>.
50
50
</para>
51
51
</listitem>
52
52
</varlistentry>
...
...
@@ -62,7 +62,7 @@
62
62
<para>
63
63
If negative <parameter>length</parameter> is passed,
64
64
<function>iconv_substr</function> cuts the portion out of
65
-
<parameter>str</parameter> from the <parameter>offset</parameter>'th
65
+
<parameter>string</parameter> from the <parameter>offset</parameter>'th
66
66
character up to the character that is
67
67
<parameter>length</parameter> characters away from the end of the string.
68
68
In case <parameter>offset</parameter> is also negative, the start position
...
...
@@ -71,10 +71,10 @@
71
71
</listitem>
72
72
</varlistentry>
73
73
<varlistentry>
74
-
<term><parameter>charset</parameter></term>
74
+
<term><parameter>encoding</parameter></term>
75
75
<listitem>
76
76
<para>
77
-
If <parameter>charset</parameter> parameter is omitted,
77
+
If <parameter>encoding</parameter> parameter is omitted or &null;,
78
78
<parameter>string</parameter> are assumed to be encoded in
79
79
<link linkend="iconv.configuration">iconv.internal_encoding</link>.
80
80
</para>
...
...
@@ -82,7 +82,7 @@
82
82
Note that <parameter>offset</parameter> and <parameter>length</parameter>
83
83
parameters are always deemed to represent offsets that are
84
84
calculated on the basis of the character set determined by
85
-
<parameter>charset</parameter>, whilst the counterpart
85
+
<parameter>encoding</parameter>, whilst the counterpart
86
86
<function>substr</function> always takes these for byte offsets.
87
87
</para>
88
88
</listitem>
...
...
@@ -94,13 +94,13 @@
94
94
<refsect1 role="returnvalues">
95
95
&reftitle.returnvalues;
96
96
<para>
97
-
Returns the portion of <parameter>str</parameter> specified by the
97
+
Returns the portion of <parameter>string</parameter> specified by the
98
98
<parameter>offset</parameter> and <parameter>length</parameter> parameters.
99
99
</para>
100
100
<para>
101
-
If <parameter>str</parameter> is shorter than <parameter>offset</parameter>
101
+
If <parameter>string</parameter> is shorter than <parameter>offset</parameter>
102
102
characters long, &false; will be returned.
103
-
If <parameter>str</parameter> is exactly <parameter>offset</parameter>
103
+
If <parameter>string</parameter> is exactly <parameter>offset</parameter>
104
104
characters long, an empty string will be returned.
105
105
</para>
106
106
</refsect1>
...
...
@@ -117,10 +117,16 @@
117
117
</row>
118
118
</thead>
119
119
<tbody>
120
+
<row>
121
+
<entry>8.0.0</entry>
122
+
<entry>
123
+
<parameter>length</parameter> and <parameter>encoding</parameter> are nullable now.
124
+
</entry>
125
+
</row>
120
126
<row>
121
127
<entry>7.0.11</entry>
122
128
<entry>
123
-
If <parameter>str</parameter> is equal to
129
+
If <parameter>string</parameter> is equal to
124
130
<parameter>offset</parameter> characters long, an empty string will be
125
131
returned. Prior to this version, &false; was returned in this case.
126
132
</entry>
...
...
@@ -143,7 +149,6 @@
143
149
</refsect1>
144
150

145
151
</refentry>
146
-

147
152
<!-- Keep this comment at the end of the file
148
153
Local variables:
149
154
mode: sgml
150
155