i'm trying to add a \ before a . or $ but it's not working, here's what i've tried:
$string=preg_replace("/([\.\$])/", "\$1", $string);
in that line, the \ doesn't show before the . or $
i've even tried
$string=preg_replace("/([\.\$])/", "\\$1", $string);
but that prints out the "$1" so it seems like the \ is escaping the $ but i do'nt know how to get this working. any help would be appreciated. thanks.