开发者

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

开发者 https://www.devze.com 2022-12-30 00:11 出处:网络
I have a facebook app that is displaying random quotes - it is written in php. One quote in the database looks like this:

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

精彩评论

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