: This article mainly introduces PHP to judge the encapsulated functions of Array dimensions. For more information about PHP tutorials, see. Sometimes need to judge the dimension of the array, the internet to check a lot of things similar to the http://www.poluoluo.com/jzxy/201306/215088.html writing this way, pulling and do not understand what meaning. I wrote the following:
Privatestaticfunctionarray_depth ($ array) {if (! Is_array ($ array) return0; $ max_depth = 1; foreach ($ arrayas $ value) {if (is_array ($ value) {$ depth = array_depth ($ value) + 1; if ($ depth> $ max_depth) {$ max_depth = $ depth ;}}return $ max_depth ;}
'). AddClass ('pre-numbering '). hide (); $ (this ). addClass ('Has-numbering '). parent (). append ($ numbering); for (I = 1; I <= lines; I ++) {$ numbering. append ($ ('
'). Text (I) ;}; $ numbering. fadeIn (1700) ;}) ;}; script
The preceding section describes the encapsulated functions used by PHP to determine the dimension of the Array, including some content. it is helpful to anyone interested in the PHP Tutorial.