Does sometime fputs() or fwrite() encode html special characters?

I am outputting a string that consists of html content to a html file, but in the html file the html special characters are encoded (for example " in \" ). I've even used htmlspecialcharacters_decode before using the write functions. The wierd part is that on my computer the characters are not encoded, while uploaded on some server are encoded. How can I deal with this problem?

Anticipated thanks!


You are probably suffering from Magic Quotes

Check you phpinfo();

To clear Magic Quotes look into the discussion at

Example (c) jeremysawesome:

array_walk_recursive($_POST, create_function('&$val', '$val = stripslashes($val);'));

Need Your Help

VB .net: How to disable/enable buttons depends who's logged in (admin account vs. ordinary account)

database ms-access button login

I'm almost done with my project and just asked my teacher for an extension. By the way, here's the last problem that I've been trying to figure out.