0

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!

andreihondrari
  • 5,743
  • 5
  • 30
  • 59
  • Could you be seeing some UTF-8 or other encoding? There is a good discussion here on this. http://stackoverflow.com/a/6337131/1132976 – uotonyh Apr 17 '12 at 22:01

1 Answers1

2

You are probably suffering from Magic Quotes

Check you phpinfo();

To clear Magic Quotes look into the discussion at php.net: http://www.php.net/manual/en/function.stripslashes.php

Example (c) jeremysawesome:

array_walk_recursive($_POST, create_function('&$val', '$val = stripslashes($val);'));
hegemon
  • 6,614
  • 2
  • 32
  • 30