I copied and pasted one paragraph in mysql table. many other paragraphs from table display alright but this one paragraph has lot of black background question marks in place of Apostrophes or single &double quotes.i have utf-8 in meta tag. surprisingly str_replace is no working either.this quote mark ( ’ ) is causing a lot of trouble can't replace it with (') using str_replace. i'have tried $story=str_replace("’","'",$story);
and $story=str_replace("\’","\'",$story);
.i have been searching through solutions but none of them seems working.
Asked
Active
Viewed 30 times
0

Nav Sandhu
- 73
- 1
- 1
- 6
1 Answers
0
utf-8 doesn't recognize the smart quote character. You will have to use the character code instead
$text = str_replace(chr(145), "'", $text); // left single quote
$text = str_replace(chr(146), "'", $text); // right single quote
$text = str_replace(chr(147), '"', $text); // left double quote
$text = str_replace(chr(148), '"', $text); // right double quote

Brian McCall
- 1,831
- 1
- 18
- 33
-
thank you so much ! but how do you find character code? thank you bro – Nav Sandhu Mar 13 '17 at 18:29
-
Here is a list of them https://www.atwebresults.com/ascii-codes.php?type=2 – Brian McCall Mar 13 '17 at 18:31
-
thanks a bunch mate.really appreciate – Nav Sandhu Mar 13 '17 at 18:34