Skip to content

Kirby 5.0.4

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 stringorarray no default value Value being searched for (needle)
$replacerequired stringorarray no default value Value to replace matches with
$limitrequired intorarray 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

Parent class

Kirby\Toolkit\Str