Given the following example:
public function replaceMyText($search, $replace, &$content)
{
$newContent = str_replace($search, $replace, $content, $count = 1)
$content = $newContent;
}
Can this cause a Warning
that only variables can be passed by reference? If so, I can't fully understand why.
Should I assigned the $content
to another variable before passing it to the str_replace
function?