Displaying the contents of an array using a loop
<?php
$shapes = array('S' => 'Cylinder',
'N' => 'Rectangle',
'A' => 'Sphere',
'O' => 'Sphere',
'P' => 'Rectangle');
foreach ($shapes as $key => $value) {
print "The $key is a $value.<br />";
}
?>
Related examples in the same category