Alex Rivera | Logout

Getting ’ instead of an apostrophe(') in PHP

Asked 2010-02-18T20:33:56.430
67

I've tried converting the text to or from utf8, which didn't seem to help.

I'm getting:

"It’s Getting the Best of Me"

It should be:

"It’s Getting the Best of Me"

I'm getting this data from this url.

Edit
Report

1 Answer

33

Make sure your html header specifies utf8

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

That usually does the trick for me (obviously if the content IS utf8).

You don't need to convert to html entities if you set the content-type.

answered 2010-03-24T06:21:34.363

Your Answer