Displaying one value from an array : Associate Array « Data Structure « PHP
- PHP
- Data Structure
- Associate Array
Displaying one value from an array
<?php
$shapes = array('S' => 'Cylinder',
'N' => 'Rectangle',
'A' => 'Sphere',
'O' => 'Sphere',
'P' => 'Rectangle');
print "A notepad is a {$shapes['Notepad']}.";
?>
Related examples in the same category