function getCitys(){
$provinceid=trim($_REQUEST[‘province‘]);
$citylist=M(‘city‘)->field(‘cityid,cityname‘)->where(‘provinceid =‘.$provinceid)->select(); //这个方法输出json数组
//echo json_encode($citylist);
$temp=‘{‘;
for ($i=0;$i<count($citylist);$i++){
if($i==count($citylist)-1){
$temp=$temp.‘"‘.$citylist[$i][‘cityid‘].‘":"‘.$citylist[$i][‘cityname‘].‘"‘;
}else{
$temp=$temp.‘"‘.$citylist[$i][‘cityid‘].‘":"‘.$citylist[$i][‘cityname‘].‘",‘;
}
}
$temp=$temp.‘}‘;
echo $temp;
}