我在html页面通过ajax传递数据到php,foreach时失败,提示Warning: Invalid argument supplied for foreach() in D:\phpStudy\WWW\test-ht\php\baocunshuju.php on line 10怎么解决?谢谢。<?phpheader("Content-Type: text/html; charset=utf-8");$data=$_POST["shuju"]; //这样post数据过来就foreach失败。//$data=[["1","2017-10-19","11","22","33","44","55","0","0","0","0","0"],["2","2017-10-20","66","77","88","99","1010","0","0","0","0","0"],["3","2017-10-21","211","222","233","244","255","311","322","333","344","355"]]; //这样直接输入数据则能成功。include("conn.php");$bcts=0;foreach ($data as $value){ $sql = "INSERT INTO dashuju (id,riqi,xinpai_db,xinpai_gz,xinpai_hz,xinpai_mn,xinpai_xy,guidang_db,guidang_gz,guidang_hz,guidang_mn,guidang_xy) VALUES ('','$value[1]','$value[2]','$value[3]','$value[4]','$value[5]','$value[6]','$value[7]','$value[8]','$value[9]','$value[10]','$value[11]')"; if($link->query($sql)){$bcts++;}}if($bcts>0){ echo "成功保持".$bcts."条";}else{ echo "保存失败" . $data;};?>