php json数组问题 你的 $result1、$result2 都是什么? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 echo json_encode( array(array("content"=>$result1), $result2) ) 是这样? $result1 和 $result2 都沒有給出。 echo json_encode(array_merge($result1, array("comments"=>$result2))) 这样?? $result 1 就是“id”:”111”, “image_name”:”我的卧室“,“image_url”:“d:/image/a.png”,这些,$result 2 单独的就是“id”:”111”, “image_name”:”我的卧室“,“image_url”:“d:/image/a.png”,后面的是$result2 $result1就是上半部,$result2就是下半部 $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)); $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); 就是有两个数组,把他们输出成一个json数组 PHP最新版本是多少? 高分寻求nginx下网址大小写问题的解决办法 问个奇怪的问题。。 程序中的接口是什么概念啊??? 拜托大家帮忙看一下 求助cookie或session问题,急 如何根据用户的权限动态地生成菜单? 这段代码是什么意思? 请问:关于PHP中utf8转换的问题。在线等待!谢谢 大家好,问一个问题 php和mssql 2000插入数据时的错误 数组赋值的问题
“image_name”:”我的卧室“,
“image_url”:“d:/image/a.png”,
这些,
$result 2
“image_name”:”我的卧室“,
“image_url”:“d:/image/a.png”,
后面的是$result2
'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));
$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);