将javascript数组传递给php数组 [英] Pass javascript array to php array

查看:79
本文介绍了将javascript数组传递给php数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好...我想问一下如何将我的JavaScript数组传递给php?
我有一个从json_encode数组中得到结果的数组,就像这样

Hi guys... i would like to ask how do i pass my javascript array to php?
I have an array that got the result from a json_encode array like so

$.ajax({
type : "POST",
url : "includes/Filter.php",
datatype: ''json'',
success: function(data){	

var obj = jQuery.parseJSON(data);
		
myArrayID= obj.ids;
}
});


现在它可以很好地检索数组...但是现在我需要将此数组传递回php,我想检索它...我该怎么做?顺便说一下,我的数组是一个关联数组


now it retrieves the array just fine... but now i need to pass this array back to php and i want to retrieve it... how do i do that? by the way my array is an Associative array

推荐答案

.ajax({ 类型:"POST", url:"includes/Filter.php", 数据类型:"json", 成功:功能(数据){ var obj = jQuery.parseJSON(data); myArrayID = obj.ids; } });
.ajax({ type : "POST", url : "includes/Filter.php", datatype: ''json'', success: function(data){ var obj = jQuery.parseJSON(data); myArrayID= obj.ids; } });


现在它可以很好地检索数组...但是现在我需要将此数组传递回php,我想检索它...我该怎么做?顺便说一下,我的数组是关联数组


now it retrieves the array just fine... but now i need to pass this array back to php and i want to retrieve it... how do i do that? by the way my array is an Associative array



这篇关于将javascript数组传递给php数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆