<?php $student = array(
1 => array(
"firstname" => "first",
"name" => "first",
"group" => "grp01",
"score" => array(
"ASP" => 86,
"PHP" => 79,
"JAVA" => 72,
"HTML" => 96,
"JAVASCRIPT" => 98,
"VBNET" => 66
)
),
2 => array(
"firstname" => "second",
"name" => "second",
"group" => "grp01",
"score" => array(
"ASP" => 80,
"PHP" => 70,
"JAVA" => 71,
"HTML" => 92,
"JAVASCRIPT" => 90,
"VBNET" => 78
)
),
3 => array(
"firstname" => "third",
"name" => "third",
"group" => "grp02",
"score" => array(
"ASP" => 88,
"PHP" => 88,
"JAVA" => 89,
"HTML" => 96,
"JAVASCRIPT" => 98,
"VBNET" => 71
)
) ); ?>
<?php
foreach($student as $std) {
foreach($std as $key => $p){
echo $std[$key];
} } ?>
i am trying to print in echo each student with they average score but right now i am stuck i got a warning about array to string convertion can someone give me some hint how i am suppose to do my loop.