Definition and usage: the substr_replace () function replaces a part of the string with another string syntax: substr_replace (string, replacement, start, length) & lt ;? Phpechos
Definition and usage:
The substr_replace () function replaces one part of the string with another.
Syntax:Substr_replace (string, replacement, start, length)
-
- Echo substr_replace ("hello world", "earth", 6 );
- ?>
Parameter description
String is required, which specifies the string to be checked.
Replacement is required, specifying the string to be inserted.
Start:Required, specifying where to start replacement of the string.
Positive number-start replacement at the start offset
Negative number-replace with the start offset at the end of the string
0-START replacement at the first character in the string
Charlist:(Optional) number of characters to be replaced.
Positive number-length of the string to be replaced
Negative number-Number of replaced characters starting from the end of the string
0-insert instead of replace