json_decode对JSON格式的字符串进行编码而json_encode对变量进行 JSON 编码,需要的朋友可以参考下
<?php
$a = '{"allcount":"107","listurl":"house","project":[{ "projcode":"3410877100", "projname":"rrr", "housecount":"5981"}]}';$array = json_decode($a,1) ;
$json = json_encode($array );
echo($json);
?>