Array being chopped off over ajax post. Ajax posting limit?

后端 未结 4 2083
温柔的废话
温柔的废话 2021-01-02 11:37

I have a multidimensional array, which consists of 426 smaller arrays, which also comprise of 4 attributes.. Below is an example of one of 426 arrays...

             


        
4条回答
  •  [愿得一人]
    2021-01-02 12:38

    You need to open your php.ini file and set (or create) this line:

    max_input_vars = 1000000

    max_input_vars has a default value of 1000, which will cut off an array at 1000 total elements. Just change it to a really high number (in my case, I needed to set it to one million).

    From the PHP Manual:

    How many input variables may be accepted (limit is applied to $_GET, $_POST and $_COOKIE superglobal separately). Use of this directive mitigates the possibility of denial of service attacks which use hash collisions. If there are more input variables than specified by this directive, an E_WARNING is issued, and further input variables are truncated from the request. This limit applies only to each nesting level of a multi-dimensional input array.

    Keep in mind: As the manual says, this default limit was put in place to prevent denial of service attacks.

    Hope this helps even though this is an old question.

提交回复
热议问题