HH\Lib\Str\replace_every
Requires the Hack Standard Library to be installed.
Facebook Engineer?
This function is available as Str\replace_every()
in Facebook's www repository.
Returns the "haystack" string with all occurrences of the keys of
$replacements
replaced by the corresponding values
namespace HH\Lib\Str;
function replace_every(
string $haystack,
KeyedContainer<string, string> $replacements,
): string;
- For a single case-sensitive search/replace, see
Str\replace()
. - For a single case-insensitive search/replace, see
Str\replace_ci()
. - For multiple case-insensitive searches/replacements, see
Str\replace_every_ci()
.
Parameters
string $haystack
KeyedContainer<string, string> $replacements
Returns
string