Possible Duplicate:
Getting ’ instead of an apostrophe(') in PHP
I am new to the PHP programming language and I need some help. When writing to a file with PHP, when an apostrophe is written to the file, it actually writes ’s. For example, when I try to write:
Hello it’s awesome
the program instead writes:
Hello it’ss awesome
I have tried multiple solutions, but still can’t get it working. If somebody could help, I would greatly appreciate it.
EDIT:
Ok so this is what i have tried:
echo mb_convert_encoding(
file_get_contents($filename),
“HTML-ENTITIES”,
“UTF-8”
);
The result was: \”Hello\” instead of “Hello”
I have also tried:
$text = fgets($fp);
$html = mb_convert_encoding($text, “HTML-ENTITIES”, “UTF-8”);
But didnt really understand what to do with that code
Also i would like to either convert a variable $stringDatad from ’s characters or convert the whole file from ’s characters. The file name is saved at $filename
try