PHP implements the method of traversing multidimensional array, PHP calendar multidimensional array
In this paper, we describe the way that PHP implements traversing multidimensional arrays. Share to everyone for your reference, as follows:
$a =array (' Fruits ' =>array (' a ' + = ' orange ', ' B ' + ' grape ',c=> ' apple '), ' numbers ' =>array (1,2,3,4,5,6), ' Holes ' =>array (' first ',5=> ' second ', ' third '));//: foreach ($a as $list + $things) {if (Is_array ($things)) { foreach ($things as $newlist = + $counter) {echo "key:". $newlist. "
"." Value: ". $counter."
"; }}} The second type: function Mulitarraytosingle ($array) { $temp =array (); if (Is_array ($array)) { foreach ($array as $key = + $value) { if (Is_array ($value)) { Mulitarraytosingle ($value); } else{ $temp []= $value;}}}
I hope this article is helpful to you in PHP programming.
http://www.bkjia.com/PHPjc/1075075.html www.bkjia.com true http://www.bkjia.com/PHPjc/1075075.html techarticle PHP implementation of the method of traversing multidimensional arrays, PHP calendar Multidimensional Array This article describes the PHP implementation of the method of traversing multidimensional arrays. Share to everyone for your reference, specifically as follows: $a =array (' Fru ...