0
我有两个数组,我需要发送数组值到PHP。当我打印从PHP返回的值时,它会打印一个空字符串。我怎么才能得到它?我的代码在下面。发送两个数组到PHP在jquery
$.ajax({
type: "POST",
url: "test2.php",
data: {
price: [101, 69, 51],
id: [1, 2, 3]
},
success: function(response) {
alert(response);
}
});
在PHP
$id=mysql_real_escape_string($_POST['id'][0]);
echo $id;
你应该先接受一些答案。 – 2012-04-08 16:39:36
我该怎么做?我是一个新来的人。 – user1264362 2012-04-08 16:43:04
您需要回到所问的所有其他问题,然后单击正确答案旁边复选标记的大纲。 – 2012-04-08 16:44:10