Defining a Multidimensional Array : Multidimensional Array « Data Structure « PHP






Defining a Multidimensional Array

<html>
<head>
<title>Defining a Multidimensional Array</title>
</head>
<body>
<?php
$characters = array (
                array ( name=>"name 1",
                        occupation=>"developer",
                        age=>30,
                        specialty=>"Java" ),
                array ( name=>"name 2",
                        occupation=>"Programmer",
                        age=>24,
                        specialty=>"C++" ),
                array ( name=>"name 3",
                        occupation=>"designer",
                        age=>63,
                        specialty=>"Javascript" )
);

print $characters[0][occupation];
?>
</body>
</html>

           
       








Related examples in the same category

1.Reference element in multidimensional Arrays
2.Looping Through a Multidimensional Array
3.Displaying a Multidimensional Array using For each
4.Accessing multidimensional array elements
5.Creating Multidimensional Arrays
6.Creating a Multidimensional Array
7.Sorting Multidimensional Arrays
8.Multidimensional array element value interpolation
9.Displaying Multidimensional Arrays
10.Displaying a multidimensional array
11.Find the Maximum Value in a Multidimensional Array
12.Generating fixed-width field data records without
13.Manipulating multidimensional arrays