O'Reilly books are informative but their downfall is that they always have the most complicated example they can find to put a simple point across. this is straight out of my PHP book:
$person[0] = "Edison";
$person[1] = "Wankel";
$person [2] = "Crapper"
$creator['Light bulb'] = "Edison";
$creator['Rotary Engine'] = "Wankel";
$creator['Toilet'] = "Crapper";
$person = array('Edison', 'Wankel', 'Crapper');
$creator = array('Light bulb' => 'Edison', 'Rotary Engine' => 'Wankel', 'Toilet' => 'Crapper');
foreach($person as $name) {
echo "Hello, $name\n";
}
foreach ($creator as $invention => $inventor) {
echo "$inventor created the $invention\n";
}
looks pretty complicated right? that's on page 27 and it's trying to explain how arrays work........it doesn't say what the => is supposed to mean so this program doesn't really make any sense for somebody who is just learning PHP like me. for all your C programmers out there, no => does not mean greater than or equal to.