Replace text within a portion of a string
substr_replace ( mixed $string , mixed $replacement , mixed $start [, mixed $length ] ) : mixed
The input string. An array of strings can be provided, in which case the replacements will occur on each string in turn. In this case, the replacement, start and length parameters may be provided either as scalar values to be applied to each input string in turn, or as arrays, in which case the corresponding array element will be used for each input string.
The replacement string.
If start is non-negative, the replacing will begin at the start'th offset into string. If start is negative, the replacing will begin at the start'th character from the end of string.
If given and is positive, it represents the length of the portion of string which is to be replaced. If it is negative, it represents the number of characters from the end of string at which to stop replacing. If it is not given, then it will default to strlen( string ); i.e. end the replacing at the end of string. Of course, if length is zero then this function will have the effect of inserting replacement into string at the given start offset.
The result string is returned. If string is an array then array is returned.
STRING REPLACEMENT START | NEGATIVE
STRING REPLACEMENT START | NON-NEGATIVE
LENGTH | NEGATIVE
LENGTH | NON-NEGATIVE
 => 1c
 => 2f
 => 3i
 => 4l
 => 5o