reference/strings/functions/str-replace.xml
464fbf0d12f89b1e723908780fb68acf667f5901
...
...
@@ -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.str-replace">
3
+
<refentry xml:id="function.str-replace" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>str_replace</refname>
6
6
<refpurpose>Replace all occurrences of the search string with the replacement string</refpurpose>
...
...
@@ -9,11 +9,11 @@
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>mixed</type><methodname>str_replace</methodname>
13
-
<methodparam><type>mixed</type><parameter>search</parameter></methodparam>
14
-
<methodparam><type>mixed</type><parameter>replace</parameter></methodparam>
15
-
<methodparam><type>mixed</type><parameter>subject</parameter></methodparam>
16
-
<methodparam choice="opt"><type>int</type><parameter role="reference">count</parameter></methodparam>
12
+
<type class="union"><type>string</type><type>array</type></type><methodname>str_replace</methodname>
13
+
<methodparam><type class="union"><type>array</type><type>string</type></type><parameter>search</parameter></methodparam>
14
+
<methodparam><type class="union"><type>array</type><type>string</type></type><parameter>replace</parameter></methodparam>
15
+
<methodparam><type class="union"><type>string</type><type>array</type></type><parameter>subject</parameter></methodparam>
16
+
<methodparam choice="opt"><type>int</type><parameter role="reference">count</parameter><initializer>&null;</initializer></methodparam>
17
17
</methodsynopsis>
18
18
<para>
19
19
This function returns a string or an array with all occurrences of
...
...
@@ -21,8 +21,8 @@
21
21
replaced with the given <parameter>replace</parameter> value.
22
22
</para>
23
23
<para>
24
-
If you don't need fancy replacing rules (like regular expressions), you
25
-
should always use this function instead of <function>preg_replace</function>.
24
+
To replace text based on a pattern rather than a fixed
25
+
string, use <function>preg_replace</function>.
26
26
</para>
27
27
</refsect1>
28
28

...
...
@@ -194,7 +194,6 @@ echo $output;
194
194
</refsect1>
195
195

196
196
</refentry>
197
-

198
197
<!-- Keep this comment at the end of the file
199
198
Local variables:
200
199
mode: sgml
201
200