Warning: Input variables exceeded 1000

后端 未结 8 2017
不知归路
不知归路 2020-12-25 13:29

I\'m building a RESTS like service in PHP that should accept a large JSON post as main data (I send and read the data much like discussed here: http://forums.laravel.io/view

8条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-25 14:07

    I think most of the time it is not necessary to increase the max_input_vars size,

    but to optimize your code,

    i had faced this problem when getting all results from one ajax request and sending that results to another ajax request.

    So what i have done is stringified the array from the db results,

    JSON.stringify(totalResults);
    

    in javascript JSON.stringify convert array to string so after converting i have send that string to another request and decoded that string to array again using json_decode in php,

    
    

    so i got that original array again,

    i hope this can help someone so i have shared it, thank you.

提交回复
热议问题