However, arrays more than three levels deep are hard to manage for most people. array( All good here – hope you are doing well also. A multidimensional array is an array that contains arrays. We provide several examples of multidimensional arrays on this page. ( [name] => Banana Bread


?>, Accessing of multidimensional arrays in PHP is very simple and is done by using either the for or for each loop which is the commonly used loops in PHP. The above example clearly displays the details of the employee along with their skills in a very user-friendly manner. [label] => cheese_cake The outer loop reads each element in the top-level array. Array elements in PHP can hold values of any type, such as numbers, strings and objects. Engineer”), Consider a scenario that a user have 10 books and each book has a different name, cost, type. [3] => Spinach Glad you found the article helpful , Thanks broo array( ), array(

( [2] => pear A multidimensional array is really just an array composed of arrays. Kale Syntax of Multidimensional Array in PHP. “Cloth_type” => “jeans”, [1] => Chocolate Cake array("Non- Fiction ", "Biography ", 600), array(element1, element2, elements3, ...), [1] => Carrot Cake

array(element1, element2, elements3, ...), echo "