<?php
include_once('api.class.php');
if(!isset($_POST['etcity'])){
$json['status']=0;
echo json_encode($json);
exit;
}
$API=new api();
$API->Select('city',"where cityname='$_POST[etcity]'");
$result=$API->mysql_db->result;
$row=mysql_fetch_array($result);$API->Select('etstype',"where etcity='$row[cityid]'",'et');
$result=$API->mysql_db->result;
if(mysql_num_rows($result)>0){
while($array=mysql_fetch_array($result)){
foreach($array as $key=>$value){
$et[$key]=$value;
}
$json['status']=1;
$json['value'][]=$et;
}
}
if(!isset($json)){
$json['status']=-1;
}
echo json_encode($json);
?>
include_once('api.class.php');
if(!isset($_POST['etcity'])){
$json['status']=0;
echo json_encode($json);
exit;
}
$API=new api();
$API->Select('city',"where cityname='$_POST[etcity]'");
$result=$API->mysql_db->result;
$row=mysql_fetch_array($result);$API->Select('etstype',"where etcity='$row[cityid]'",'et');
$result=$API->mysql_db->result;
if(mysql_num_rows($result)>0){
while($array=mysql_fetch_array($result)){
foreach($array as $key=>$value){
$et[$key]=$value;
}
$json['status']=1;
$json['value'][]=$et;
}
}
if(!isset($json)){
$json['status']=-1;
}
echo json_encode($json);
?>
是不是Ios那过使用的编码是gbk的,两边使用的编码不一致
尽可能的提供多一点的信息,这样才有可能获得更多的帮助
当然,前提是你想把问题解决了