Universeorange.com/Docs/

R3m/framework Function reference string.substring.replace

{string.substring.replace(String | Array $string, String | Array $replace, Int | Array $offset=0, Int | Array $length=null)}

Replace text within a portion of a string.

{string.substring.replace()} replaces a copy of string delimited by the offset and (optionally) length parameters with the string given in replace.

string 
    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 replace, offset 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.
replace 
    The replacement string.
offset 
    If offset is non-negative, the replacing will begin at the offset'th offset into string.
    If offset is negative, the replacing will begin at the offset'th character from the end of string.
length 
    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 {string.length( 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 replace into string at the given offset.

The result string is returned.
If string is an array then an array is returned.

More information:

https://www.php.net/manual/en/function.substr-replace.php

Last modified: 2021-06-07

© 2021 universeorange.com