I need to remove some weird characters in a string pulled from a source database using a regex because these characters can be located anywhere in the string and can be a little different. Here's my code right now:
$str = "LIVR DEC 20 23 $é**é$01$";
$result = preg_replace("/\$[^ ]+\$/", "", $str);
When testing it on phpliveregex.com, it works fine but when i run the code (using PHP 5.4), i get the following error:
PHP Notice: Undefined variable: é
and $result contains the original string. Why is it throwing that error?