你的 $result1、$result2 都是什么?

解决方案 »

  1.   

    echo json_encode( array(array("content"=>$result1), $result2) )  是这样?
      

  2.   

    $result1 和 $result2 都沒有給出。
      

  3.   

    echo json_encode(array_merge($result1, array("comments"=>$result2)))   这样??
      

  4.   

    $result 1 就是“id”:”111”,
     “image_name”:”我的卧室“,
    “image_url”:“d:/image/a.png”,
    这些,
    $result 2 
      

  5.   

    单独的就是“id”:”111”,
     “image_name”:”我的卧室“,
    “image_url”:“d:/image/a.png”,
    后面的是$result2
      

  6.   

    $result1就是上半部,$result2就是下半部
      

  7.   

    $result1 = array(
      'id' => 111,
      'image_name' => '我的卧室',
      'image_url' => 'd:/image/a.png',
    );$result2 = array(
      'comments' => array(
        array(
          'uid' => 122,
          'cname' => '小明',
          'ctime' => '2014-12-12',
        ),
      ),
    );echo json_encode(array_merge($result1, $result2));
      

  8.   


    $result1 = array(
    'id' => '111',
    'image_name' => '我的卧室',
    'image_url' => 'd:/image/a.png'
    );$result2 = array(
    'comments' => array(
    array(
    'uid' => '122',
    'cname' => '小明',
    'ctime' => '2014-12-12'
    )
    )
    );$result = array_merge($result1, $result2);
    echo json_encode($result);
      

  9.   

    就是有两个数组,把他们输出成一个json数组