Str::replace()
Replaces all or some occurrences of the search string with the replacement string Extension of the str_replace() function in PHP with an additional $limit parameter
Parameters
Name | Type | Default | Description |
---|---|---|---|
$string * | Kirby\Toolkit\Collection |array |string |
– | String being replaced on (haystack); can be an array of multiple subject strings |
$search * | Kirby\Toolkit\Collection |array |string |
– | Value being searched for (needle) |
$replace * | Kirby\Toolkit\Collection |array |string |
– | Value to replace matches with |
$limit | array |int |
-1 |
Maximum possible replacements for each search value; multiple limits for each search value are supported; defaults to no limit |
Return type
array
|string