A simple str_replace is used, unless $regularExpression is set
to TRUE. In that case preg_replace is used. The given patterns
are used as given, no quoting is applied!
In case $regularExpression is TRUE, a closure can be given for
the $replace variable. It should return a string and is given an
array of matches as parameter.
public static searchAndReplace ( string $search, string | Closure $replace, string $pathAndFilename, boolean $regularExpression = false ) : boolean | null | ||
$search | string | |
$replace | string | Closure | |
$pathAndFilename | string | |
$regularExpression | boolean | |
리턴 | boolean | null | FALSE on errors, NULL on skip, TRUE on success |