【发布时间】:2011-08-15 01:28:29
【问题描述】:
我将一个数组从 php 返回到 json
这里是 php 数组
$cities = array();
while($row = mysql_fetch_array($result)){
$cityRow= array('cityNo'=>$row['city_no'], 'cityName'=>$row['city_name']);
$cities[]=$cityRow;
}
echo json_encode($cities);
这是 json
$.getJSON("controllers/Customer.controller.php",param,function(result){
// what should I write here to reach the array elements??
});
【问题讨论】: