Answers for "php create multidimensional associative array"

PHP
2

convert multidimensional array to single array php

$singleArray = []; 
foreach ($parentArray as $childArray) 
{ 
    foreach ($childArray as $value) 
    { 
    $singleArray[] = $value; 
    } 
}
Posted by: Guest on October-13-2020
0

php multidimensional associative array

Array
(
    [klaussen] => Array
        (
            [physics] => 85
            [maths] => 78
            [chemistry] => 89
        )

    [morkel] => Array
        (
            [physics] => 68
            [maths] => 73
            [chemistry] => 79
        )

    [styen] => Array
        (
            [physics] => 62
            [maths] => 67
            [chemistry] => 92
        )

)
Posted by: Guest on September-14-2021
0

how to create multidimensional array in php

$cars = array
  (
  array("Volvo",22,18),
  array("BMW",15,13),
  array("Saab",5,2),
  array("Land Rover",17,15)
  );
Posted by: Guest on April-30-2020
-1

multidimensional array in php

<?php 
/* 
There are 3 Types of array in php  
1. Indexed arrays - Arrays with a numeric index
2. Associative arrays - Arrays with named keys
3. Multidimensional arrays - Arrays containing one or more arrays

This is the third one - Multidimensional arrays
*/

$carsModel = array
  (
  array("Maruti",21,28),
  array("BMW",05,75),
  array("Tata",25,12),
  array("Land Rover",11,20)
  );
?>
Posted by: Guest on June-10-2020

Code answers related to "php create multidimensional associative array"

Browse Popular Code Answers by Language