Hi: I am trying to generate and access a simple array of students and grades. I can get the array built (eventually I will populate it via a form), but I don’t see how to access the individual elements.
I tried this approach:
[php]$grades=array(array(‘id’=>201256, ‘name’=>‘Frank Thomas’, ‘scores’=>array(90,97,95,85)),
array(‘id’=>201297, ‘name’=>‘Anne West’, ‘scores’=>array (98,75,90,85)));
print_r($grades);
echo $grades[0][0]." is ". $grades[0][1];[/php]
The print_r works fine, but I get an “undefined index” error on the echo line. (I want it to print out “201256 is Frank Thomas”)
I’d really like to do something like $grades[0][‘id’] etc, but obviously those give me errors, too.
Thanks for any help.
Ed