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
精彩评论