Manipulating multidimensional arrays : Multidimensional Array « Data Structure « PHP






Manipulating multidimensional arrays

 
<?
$prices['dinner']['A'] = 12.50;
$prices['lunch']['B'] = 4.95;
$prices['dinner']['C'] = 8.95;

$prices['dinner']['total'] = $prices['dinner']['A'] +
                             $prices['dinner']['B'];

$specials[0][0] = 'aa';
$specials[0][1] = 'bb';
$specials[0][2] = 'cc';
$specials[1][0] = 'dd';
$specials[1][1] = 'ee';

$specials[1][] = 'Peanut Salad';
?>
  
  








Related examples in the same category

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