Here is the script as it appears after you suggestions.
<html>
<head>
<title>arrays-1</title>
</head>
<body>
<?php
$characters = array (
array (name=>"bob",
occupation=>"superhero",
age=>30,
specialty=>"x-ray vision"),
array (name=>"sally",
occupation=>"superhero",
age=>24,
specialty=>"superhuman strength"),
array (name=>"mary",
occupation=>"arch villian",
age=>63,
specialty=>"nanotechnology")
);
echo $characters[0]['occupation'];
// prints "superhero"
?>
</body>
</html>
I'm a newbie and learning out of a book....I also have a question about the following array which comes from the php manual.
<?php
$arr = array("somearray" => array(6 => 5, 13 => 9, "a" => 42));
echo $arr["somearray"][6]; // 5
echo $arr["somearray"][13]; // 9
echo $arr["somearray"]["a"]; // 42
?>
Am I correct in thinking:
the variable $arr contains an array within an array...."somearray is referring to what..??
I'm just trying to learn what refers what??
Thanks.
Adrian