This article describes the method of recursively traversing multi-dimensional arrays in php. Share it with everyone for your reference. The details are as follows:
<?php function get_array_elems($arrResult, $where="array"){ while(list($key,$value)=each($arrResult)){ if (is_array($value)){ get_array_elems($value, $where."[$key]"); } else { for ($i=0; $i<count($value);$i++){ echo $where."[$key]=".$value."<BR>\n"; } } } } get_array_elems($arrResult); ?>
I hope this article will be helpful to everyone’s PHP programming design.