当前位置: 动力学知识库 > 问答 > 编程问答 >

php - json chop my array's length

问题描述:

I try to pass an array to json. However, when the array has more than 96 elements, it automatically remove the rest elements. no error message. I don't know why?

For examples, if I define pids = new Array {'n0','01','n2',......'n95','n96'}, n96 is ignored.

Here is my code

var pids = [];

$('#moduleForm input[name="module[properties][]"]').each(function(){

if($(this).attr('checked') == true) pids.push($(this).val());

});

var formData = {

'module[properties][]':pids

};

Till the above step, module[properties] has all values. n0 to n96.

var options = {

url:'Module',

data:formData,

dataType:'json',

timeout:60000,

success:saveCallBack,

error:ajaxError

};

$.ajax(options);

Is there a config setting somewhere I need to adjust? I use php5.


Here is the data that is passed to json

status

0

data

Object { moduleId="1009", name="adsman", shortName="adsman", more...}

moduleId

"1009"

name

"adsman"

shortName

"adsman"

isInternal

"0"

status

"1"

properties

["0", "1", "2", 93 more...] // actually, it suppose to have 99 elements.

error

null


in php.ini post_max_size = 9M

Thanks.

网友答案:

I'm sure this is not a JSON issue but instead you are probably POSTing more than your server will accept. Try increasing post_max_size in your php.ini. And possibly upload_max_filesize.

分享给朋友:
您可能感兴趣的文章:
随机阅读: