The T_CONSTANT_ENCAPSED_STRING error usually means that you forgot a ; after some line in your code. Your use of str_replace is correct if your goal is to remove the spaces and $.
the single quotes will stop the $ from being resolved.
Finger
9:41 pm on Dec 18, 2004 (gmt 0)
Sorry, in my last post I didn't catch the $ in the double quotes (I ran the code and it worked for me). jatar is correct, and you can also use double quotes if you escape the $ with \. So the last line would be: