replace

Replaces all occurrences of $search in $str by $replacement.

Description

static replace(string|array $search, string|array $replacement, bool $caseSensitive = 1)

Parameters

  • string|array $search
    The needle to search for.

  • string|array $replacement
    The string to replace with.

  • bool $caseSensitive
    To enforce case-sensitivity or not.

Return Value

static
String after the replacements.