Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $students = array(
- 'student1' => array(
- 'name' => "Ronny Berntsen",
- 'stud_id' => "123456",
- 'GPA' => "4.5"
- ),
- 'student2' => array(
- 'name' => "Sondre Berntsen",
- 'stud_id' => "123456",
- 'GPA' => "4.5"
- ),
- 'student3' => array(
- 'name' => "Ultin Berntsen",
- 'stud_id' => "123456",
- 'GPA' => "4.5"
- ),
- 'student4' => array(
- 'name' => "Herbert Berntsen",
- 'stud_id' => "123456",
- 'GPA' => "4.5"
- ),
- 'student5' => array(
- 'name' => "Vilde Berntsen",
- 'stud_id' => "123456",
- 'GPA' => "4.5"
- ),
- 'student6' => array(
- 'name' => "Nina Berntsen",
- 'stud_id' => "123456",
- 'GPA' => "4.5"
- ),
- );
- /*
- foreach ($students as $student => $stud_info)
- foreach ($stud_info as $key => $value)
- echo "$student: $key = $value<br>";
- */
- foreach ($students as $student) {
- $studCount = 0;
- foreach ($students as $student) {
- $studCount++;
- echo "$studCount:<br>";
- };
- foreach ($student as $subKey => $value) {
- echo "$subKey: $value<br>";
- };
- };
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement