PHP Multidimensional Array

PHP multidimensional array is also known as array of arrays. It allows you to store tabular data in an array. PHP multidimensional array can be represented in the form of matrix which is represented by row * column.

<?php
  $two_dimensional_array = array (
    "fruits"  => array("index" => "orange", "index2" => "banana", "index3" => "apple"),
    "numbers" => array(1, 2, 3, 4, 5, 6),
);
?>

var_dump() statement gives the following output:

array(2) { ["fruits"]=> array(3) { ["index"]=> string(6) "orange" ["index2"]=> string(6) "banana" ["index3"]=> string(5) "apple" } ["numbers"]=> array(6) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) [4]=> int(5) [5]=> int(6) } }