A place where the Joyent community can gather, help each other out, and stay informed.
You are not logged in.
I use php function file_put_contents() to write text to a file. It works fine in my TxD host but kinda funny on my localhost (XAMPP on Windows XP). It writes extra escape char \ in front of single quote char.
Any hint to cure this would be appreciated.
Offline
It seems that I have to make use of stripslashes() function. I will try that. If it does not work I will post more of what and why here.
Offline
ngungo, where's the text that you are writing originating from? It sounds like a magic_quotes issue.
stripslashes(), while it may work, will cause adverse effects the slashes aren't occurring on all servers.
Offline
Right. You're right. Thanks!
Offline
juxta,
It does not seem working.
I edited the php.ini then stopped & start Apache. Is that right? What else I have to do?
Offline
Check using phpinfo(); or what Andy mentioned to make sure it is in fact disabling it. I've had a case where I was editing the wrong php.ini before...
Also, if there are any other magic_quote setting turn them off as well. Magic quotes are evil quotes.
Offline
If that is the problem and you can't turn it off here's some code that should compensate:
if (get_magic_quotes_gpc()) {
$_GET = array_map('stripslashes', $_GET);
$_POST = array_map('stripslashes', $_POST);
}
Offline
Working! Working! Thanks! Thanks!!!
I never had a chance to use the array_map() before. This is my first. Excited. HAHAH!!!
Offline