I am getting special characters from the textarea input on my form
So if I enter the below text
Philbrick, whose “In the Heart of the Sea: The Tragedy of the Whaleship Essex” recounted the real-life inspiration for Melville’s shipwreck, wears his erudition lightly.
I get the following when I access it in php.
Philbrick, whose “In the Heart of the Sea: The Tragedy of the Whaleship Essex†recounted the real-life inspiration for Melville’s shipwreck, wears his erudition lightly.
I tried the below before accessing the text , but replace is not working. Are these special characters not matching when I am copy pasting those in the code or its something else which is missing?
$string = htmlspecialchars($_POST["t"]) ;
$string = html_entity_decode($string, ENT_QUOTES, "UTF-8");
$string = str_replace('“', "\"", $string);
$string = str_replace('’', "'", $string);