reference/strings/functions/substr-replace.xml
e095023e408c8cb6378ae16bb6870343a3946919
...
...
@@ -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.substr-replace">
3
+
<refentry xml:id="function.substr-replace" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>substr_replace</refname>
6
6
<refpurpose>Replace text within a portion of a string</refpurpose>
...
...
@@ -9,18 +9,18 @@
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>mixed</type><methodname>substr_replace</methodname>
13
-
<methodparam><type>mixed</type><parameter>string</parameter></methodparam>
14
-
<methodparam><type>mixed</type><parameter>replacement</parameter></methodparam>
15
-
<methodparam><type>mixed</type><parameter>start</parameter></methodparam>
16
-
<methodparam choice="opt"><type>mixed</type><parameter>length</parameter></methodparam>
12
+
<type class="union"><type>string</type><type>array</type></type><methodname>substr_replace</methodname>
13
+
<methodparam><type class="union"><type>array</type><type>string</type></type><parameter>string</parameter></methodparam>
14
+
<methodparam><type class="union"><type>array</type><type>string</type></type><parameter>replace</parameter></methodparam>
15
+
<methodparam><type class="union"><type>array</type><type>int</type></type><parameter>offset</parameter></methodparam>
16
+
<methodparam choice="opt"><type class="union"><type>array</type><type>int</type><type>null</type></type><parameter>length</parameter><initializer>&null;</initializer></methodparam>
17
17
</methodsynopsis>
18
18
<para>
19
19
<function>substr_replace</function> replaces a copy of
20
20
<parameter>string</parameter> delimited by the
21
-
<parameter>start</parameter> and (optionally)
21
+
<parameter>offset</parameter> and (optionally)
22
22
<parameter>length</parameter> parameters with the string given in
23
-
<parameter>replacement</parameter>.
23
+
<parameter>replace</parameter>.
24
24
</para>
25
25
</refsect1>
26
26

...
...
@@ -37,7 +37,7 @@
37
37
<para>
38
38
An <type>array</type> of <type>string</type>s can be provided, in which
39
39
case the replacements will occur on each string in turn. In this case,
40
-
the <parameter>replacement</parameter>, <parameter>start</parameter>
40
+
the <parameter>replace</parameter>, <parameter>offset</parameter>
41
41
and <parameter>length</parameter> parameters may be provided either as
42
42
scalar values to be applied to each input string in turn, or as
43
43
<type>array</type>s, in which case the corresponding array element will
...
...
@@ -46,7 +46,7 @@
46
46
</listitem>
47
47
</varlistentry>
48
48
<varlistentry>
49
-
<term><parameter>replacement</parameter></term>
49
+
<term><parameter>replace</parameter></term>
50
50
<listitem>
51
51
<para>
52
52
The replacement string.
...
...
@@ -54,16 +54,16 @@
54
54
</listitem>
55
55
</varlistentry>
56
56
<varlistentry>
57
-
<term><parameter>start</parameter></term>
57
+
<term><parameter>offset</parameter></term>
58
58
<listitem>
59
59
<para>
60
-
If <parameter>start</parameter> is positive, the replacing will
61
-
begin at the <parameter>start</parameter>'th offset into
60
+
If <parameter>offset</parameter> is non-negative, the replacing will
61
+
begin at the <parameter>offset</parameter>'th offset into
62
62
<parameter>string</parameter>.
63
63
</para>
64
64
<para>
65
-
If <parameter>start</parameter> is negative, the replacing will
66
-
begin at the <parameter>start</parameter>'th character from the
65
+
If <parameter>offset</parameter> is negative, the replacing will
66
+
begin at the <parameter>offset</parameter>'th character from the
67
67
end of <parameter>string</parameter>.
68
68
</para>
69
69
</listitem>
...
...
@@ -80,9 +80,9 @@
80
80
<parameter>string</parameter> ); i.e. end the replacing at the
81
81
end of <parameter>string</parameter>. Of course, if
82
82
<parameter>length</parameter> is zero then this function will have the
83
-
effect of inserting <parameter>replacement</parameter> into
83
+
effect of inserting <parameter>replace</parameter> into
84
84
<parameter>string</parameter> at the given
85
-
<parameter>start</parameter> offset.
85
+
<parameter>offset</parameter> offset.
86
86
</para>
87
87
</listitem>
88
88
</varlistentry>
...
...
@@ -98,6 +98,30 @@
98
98
</para>
99
99
</refsect1>
100
100

101
+
<refsect1 role="changelog">
102
+
&reftitle.changelog;
103
+
<para>
104
+
<informaltable>
105
+
<tgroup cols="2">
106
+
<thead>
107
+
<row>
108
+
<entry>&Version;</entry>
109
+
<entry>&Description;</entry>
110
+
</row>
111
+
</thead>
112
+
<tbody>
113
+
<row>
114
+
<entry>8.0.0</entry>
115
+
<entry>
116
+
<parameter>length</parameter> is nullable now.
117
+
</entry>
118
+
</row>
119
+
</tbody>
120
+
</tgroup>
121
+
</informaltable>
122
+
</para>
123
+
</refsect1>
124
+

101
125
<refsect1 role="examples">
102
126
&reftitle.examples;
103
127
<para>
...
...
@@ -180,7 +204,6 @@ A: AAAXX; B: BBBX; C: CCC
180
204
</refsect1>
181
205

182
206
</refentry>
183
-

184
207
<!-- Keep this comment at the end of the file
185
208
Local variables:
186
209
mode: sgml
187
210