小程序:
var Datas = [];
for (var i = 0; i < flise.length;i++){
Datas.push([{ "img": flise[i] }, { "fapiao": fapiao[i]}]);
}
Datas = JSON.stringify(Datas);小程序传输的数据:

php:
经测试 直接 $_POST['Datas'] 接收 能接收到 但是解析不出来
后来百度到
$command = isset($GLOBALS['HTTP_RAW_POST_DATA']) ? $GLOBALS['HTTP_RAW_POST_DATA'] : file_get_contents("php://input");
$command_decode = urldecode($command);
parse_str($command_decode, $output);
$photo_datas = json_decode($output['Datas'],true);
/*$photo_datas 为最终要的结果 */可百度查各函数的用法
相关推荐:
以上就是php中如何得到小程序传来的json数组数据(代码)的详细内容,更多请关注php中文网其它相关文章!
……