php使用json_encode后出现中文乱码的解决方法

<?php
header("content-type:text/html;charset=utf-8");
$data = array('a'=>123,'b'=>'VVV','c'=>'发士大夫','d'=>88,'e'=>'大声道');

var_dump($data);
echo '<br>';
$a = json_encode($data);
var_dump($a);
echo '<br/>';
$b = json_decode($a,true);
var_dump($b);
echo '<br/>';
echo '<hr/>';
$arr = array(urlencode("姓名")=>urlencode("地方撒旦"),urlencode("博客")=>urlencode("得到"));
var_dump($arr);

echo '<br/>';
echo urldecode(json_encode($arr));

?>

posted @ 2016-02-04 14:20  侠岚之弋痕夕  阅读(1077)  评论(0编辑  收藏  举报
Where is the starting point, we don't have a choice, but the destination where we can pursue!