September 2001
Intermediate to advanced
768 pages
32h 45m
English
string substr_replace(string string, string replacement, int start, [int length])
| string | String to search |
| replacement | Replacement string |
| start | Starting offset of the substring |
| length | Length of the substring |
Replaces part of a string with another string.
Returns:
String
Description:
substr_replace() is used to replace part of a string with another. The substring to be replaced is specified as a range using the start and length arguments. The string to replace this range of characters is specified with the replacement argument.
Behavior of the start and length arguments is interesting, allowing for a great deal of flexibility in choosing what part of the string to replace. See the following table for details.
| Argument |
|---|
Read now
Unlock full access