开发者

"'" is displayed as u0027 in facebook app - how to fix that?

I have a facebook app that is displaying random quotes - it is written in php.

One quote in the database looks like this:

"There's only one rule in photography - nev开发者_JAVA技巧er develop colour film in chicken noodle soup. - Freeman Patterson"

When it is seen on facebook it looks like this:

"Thereu0027s only one rule in photography - never develop colour film in chicken noodle soup. - Freeman Patterson"

How do I fix it?


Could it be a case of needing to HTML Encode that character before passing it to Facebook?

htmlentities( $quote_string , ENT_QUOTES );

Which, in the case of the above would return

$str = "There's only one rule in photography - never develop colour film in chicken noodle soup. - Freeman Patterson";
$ret = htmlentities( $str , ENT_QUOTES );
echo $ret;

Would return:

There's only one rule in photography - never develop colour film in chicken noodle soup. - Freeman Patterson

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜