Home >Backend Development >PHP Tutorial >php---ajax passes multidimensional array to the background
php---ajax passes multi-dimensional arrays to the background. Friends in need can refer to it. 1 traditional:true ??Online information generally says that if the ajax parameter traditional is set to true, then the array can be converted into a format string, but this still requires string parsing in the background. This method is too troublesome, so I didn’t test it myself. 2 Convert js object (or array) to json??The main difference between object and array is that one is an object and the other is an array. The object is surrounded by curly brackets {}, and the array is surrounded by square brackets [].
??After passing it to the background, decode json through json_decode(data);. Similarly, you can check whether the decoded data is correct, and you can return the data through ajaxReturn(). For debugging methods, please refer to this article http://blog.csdn.net/freeape/article/details/50072069. |