Possible Duplicate:
Dollar ($) sign in password string treated as variable
I am using a code where there has to be a $ in the text.
$curlObj = curl_init();
curl_setopt($curlObj, CURLOPT_URL, "URL");
curl_setopt($curlObj, CURLOPT_USERPWD, "user:$ape0ZDPvxE/");
curl_exec($curlObj);
curl_close($curlObj);
As you can see, the password is md5’ed, and thus there is a $ in it. When I execute this, I get an undefined variable exception. Does anyone know how to prevent this?
It’s been a while since I wrote PHP, but I believe that if you use single quotes(‘) instead of double quotes(“), PHP won’t evaluate it.
You may also be able to escape it with a backslash:
\$.