mrforexify mrforexify - 1 year ago 73
Ajax Question

Jquery ajax is cutting the arrays?

I'm sending two arrays of data to laravel controller. Before sending the length of arrays is about 220 each. Then for test I'm returning response in json back to jquery again with length of arrays and the first one is ok - 220 and the second array is ~114 length.

enter image description here

How can I solve it?

Jquery ajax:

console.log('Array first before '+arr.length);
console.log('Array second before '+arr_planned.length);

data: {
}).done(function(msg) {


$array_normal = $request['arr'];
$array_planned = $request['arr_planned'];

return response()->json(['Array first after' => sizeof($array_normal),'Array second after' => sizeof($array_planned)],200);


I'm seeing right now that the array length is limited to 334 (based on other array test).

Second image

Answer Source

It's very likely that the problem is how many variables are accepted in requests in your php.ini config. You should uncomment the ;max_input_vars = 100 to something like max_input_vars = 100000.

Hope it'll help.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download