解决方案 »

  1.   

    给出连接 输出 json?是这个意思?
      

  2.   


    $arr = array('连接成功');
    echo json_encode($arr);最简单的 不过这样肯定不行的 哈哈
      

  3.   

    http://sxxxxx/json.php?type=1
    http://sxxxxx/json.php?type=2
    header('Content-type: application/json');
    $type = isset($_GET['type']) ? intval($_GET['type']) : 1;$array = array();
    if ($type == 1) {
      $array = array("test" => "I'm 1");
    } else if ($type == 2) {
      $array = array("test" => "I'm 2");
    }echo json_encode($array);