I want to echo a string with the variable inside including the ($) like so:
echo "$string";
I dont want it to echo the variable for string, I want it to echo '$string' itself, and not the contents of a variable. I know I can do this by adding a '\' in front of the ($), but I want to use preg_replace to do it. I tried this and it doesnt work:
$new = preg_replace("/\$/","\\$",$text);