Str::replacements()
Generates a replacement array out of dynamic input data Used for Str::replace()
Str::replacements(string|array $search, string|array $replace, int|array $limit): array
Parameters
Name | Type | Default | Description |
---|---|---|---|
$searchrequired | string orarray |
no default value | Value being searched for (needle) |
$replacerequired | string orarray |
no default value | Value to replace matches with |
$limitrequired | int orarray |
no default value | Maximum possible replacements for each search value; multiple limits for each search value are supported; defaults to no limit |
Return type
array
List of replacement arrays, each with a 'search', 'replace' and 'limit' attribute