1$singleArray = [];
2foreach ($parentArray as $childArray)
3{
4 foreach ($childArray as $value)
5 {
6 $singleArray[] = $value;
7 }
8}
9
1Array
2(
3 [klaussen] => Array
4 (
5 [physics] => 85
6 [maths] => 78
7 [chemistry] => 89
8 )
9
10 [morkel] => Array
11 (
12 [physics] => 68
13 [maths] => 73
14 [chemistry] => 79
15 )
16
17 [styen] => Array
18 (
19 [physics] => 62
20 [maths] => 67
21 [chemistry] => 92
22 )
23
24)
25
1$cars = array
2 (
3 array("Volvo",22,18),
4 array("BMW",15,13),
5 array("Saab",5,2),
6 array("Land Rover",17,15)
7 );
1<?php
2/*
3There are 3 Types of array in php
41. Indexed arrays - Arrays with a numeric index
52. Associative arrays - Arrays with named keys
63. Multidimensional arrays - Arrays containing one or more arrays
7
8This is the third one - Multidimensional arrays
9*/
10
11$carsModel = array
12 (
13 array("Maruti",21,28),
14 array("BMW",05,75),
15 array("Tata",25,12),
16 array("Land Rover",11,20)
17 );
18?>