<?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);
 ?>

解决方案 »

  1.   

    没有报错  这个接口  安卓可以取出数据来  但ios不行   ios那边说是我的编码有问题  后来我用了二种编码(utf8、utf8无BOM)但是都不行  
      

  2.   


    是不是Ios那过使用的编码是gbk的,两边使用的编码不一致
      

  3.   

    他们那边是用的utf8
      

  4.   

    用header输出一下utf-8编码试试看
      

  5.   

    数据是对的  就是ios无法解析  
      

  6.   

    什么都没提示    ios那边就是报了一个无法解析的数据的一个错误
      

  7.   

    http://www.baidu.com/s?wd=ios%E6%97%A0%E6%B3%95%E8%A7%A3%E6%9E%90%E7%9A%84%E6%95%B0%E6%8D%AE&ie=utf-8
    尽可能的提供多一点的信息,这样才有可能获得更多的帮助
    当然,前提是你想把问题解决了