{ // Accessing a particular element in a 2D array In general practice, associative arrays are stored inside multidimensional arrays. Each array within the multidimensional array can be either indexed array or associative array. Multidimensional array— An array containing one or more arrays within itself. You can define 10 dimensional (or more) array if you want. Associative (string) keys will be maintained, but numeric keys will be re-indexed. } /* It is a multidimensional 2D array of clothes in which the main array holds another arrays of having 2 elements like cloth type and quantity */ echo ""; “Brand” => “Levis”, We can also make the main array in the below example as associative like we have done in a 2D array with the key as the brand name which makes it easier for the customer to understand while accessing and storing it. While that looks strange in this simple example, it's actually more useful in cases where one of the values already is an array, and you want to merge another item in that array… $employee_details[ ] = array(“Raghav”, “Delhi”, “Jr. array (“item5, “bcd5”, 200)), Let's see a simple example of PHP multidimensional array to display following tabular data. The second block of PHP shows how to access all of the data in the array. The top-level array contains 3 elements. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section.Your comment will help us for help you more and improve us. This tutorial exemplifies how to push a multi-dimensional array into another array, a single element into an array, and so on. The data array needs to be passed as a parameter in generateXML() function. echo "