在json响应中显示“ - ”的ASCII代码而不是“ - ”?

时间:2014-09-18 06:30:23

标签: php json special-characters htmlspecialchars

After the text expert there should be -, but it shows some characters in the image

我想显示 - 而不是那些字符。 我怎么才能得到它? 实际上我尝试使用以下代码:

 header('Content-type: application/json; charset=utf-8'); // Even i insert the charset=utf-8 i did not get the result properly      
 $content=apply_filters('the_content', $post->post_content); 
 $contents=preg_replace(" (<([a-z]+)>.*?</\\1>)is","-",$content);

但它不会返回我想要的结果。

Json回复

{"page_details":[{"content":"<h2>Ask The Expert \u2013 Marijuana<\/h2>\n<h4><\/h4>\n<h4>xxxx \u00a0Find out what you can and can\u2019t do when consuming. <\/h4>\n","date":"22 August 2014","image_url":"http:\/\/xxx\/xxx\/xxx-xxxx\/xxxx\/2014\/08\/xxxx-us.jpg"}]}

需要!!

0 个答案:

没有答案