PHP uses JSON Chinese garbled code to solve the problem. Json. php? Php $ jsonarray (0 array (id13, name table tennis,), 1 array (id17, name Basketball,); print_r ($ json); $ codejson_encode ($ json ); echopreg_replace (# u ([0-json. php
$ Json = array (
0 => array (
Id => 13,
Name => table tennis,
),
1 => array (
Id => 17,
Name => basketball,
)
);
Print_r ($ json );
$ Code = json_encode ($ json );
Echo preg_replace ("# \ u ([0-9a-f]) # ie", "iconv (UCS-2, UTF-8, pack (H4, \ 1)", $ code );
?>
Json.html
Script
$. GetJSON ("json. php ",
Function (data ){
For (var I = 0; I <data. length; I ){
Alert (data [I]. name );
}
});
Script
Http://www.bkjia.com/PHPjc/486054.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/486054.htmlTechArticlejson.php? Php $ json = array (0 = array (id = 13, name = table tennis,), 1 = array (id = 17, name = basketball ,)); print_r ($ json); $ code = json_encode ($ json); echo preg_replace ("# \ u ([0 -...