Please note, this is a STATIC archive of website webdevelopmenttutorials.com from 20 Jul 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.

Tutorials

Learn web design and programming with our free video and text tutorials.

Web Designer? Design and market your own professional website with easy-to-use tools.

PHP Multi-Dimensional Arrays Tutorial

A multi-dimensional array is an array value that is set to another array within the main array, which is basicaly a list within a list.

<?php
$firstcouple = array("male" => array(
"firstname"=>"Angel",
"lastname"=>"Rico",
"age"=>124
),

"female" => array
(
"firstname"=>"Bertha",
"lastname"=>"Rico",
"age"=>123
)
);

echo $firstcouple["male"] ["firstname"];
echo " & ";
echo $firstcouple["female"] ["firstname"];
?>

The code above outputs:

Angel & Bertha