How to decode strange HTML entities like &#8217 in wordpress?

对着背影说爱祢 提交于 2020-05-17 06:26:07

问题


I'm developing WordPress Android app which loads post from my Wordpress site using JSON API. In JSON data its found some special characters &#8230, &#8217, &#8230. when android webview loads post it stops loading at this special characters. It doesn't loads the data after this characters. How to decode or skip/delete these characters in wordpress site or android app.

In one of the post contain &#8217 after this character post is not visible. It has decoded only & but failed to decode #8217

I'm newbie in wordpress.

JSON link for POST

app post screenshot


回答1:


You can decode the output with the function html_entity_decode

$input = "Hello friends I’m sharing my experience...."
echo html_entity_decode($input);

outputs to: Hello friends I’m sharing my experience....



来源:https://stackoverflow.com/questions/61563349/how-to-decode-strange-html-entities-like-8217-in-wordpress

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!