
- PHP 7 Tutorial
- PHP 7 - Home
- PHP 7 - Introduction
- PHP 7 - Performance
- PHP 7 - Environment Setup
- PHP 7 - Scalar Type Declarations
- PHP 7 - Return Type Declarations
- PHP 7 - Null Coalescing Operator
- PHP 7 - Spaceship Operator
- PHP 7 - Constant Arrays
- PHP 7 - Anonymous Classes
- PHP 7 - Closure::call()
- PHP 7 - Filtered unserialize()
- PHP 7 - IntlChar
- PHP 7 - CSPRNG
- PHP 7 - Expectations
- PHP 7 - use Statement
- PHP 7 - Error Handling
- PHP 7 - Integer Division
- PHP 7 - Session Options
- PHP 7 - Deprecated Features
- PHP 7 - Removed Extensions & SAPIs
- PHP 7 Useful Resources
- PHP 7 - Quick Guide
- PHP 7 - Useful Resources
- PHP 7 - Discussion
What are multidimensional associative arrays in PHP? How to retrieve values from them?
Multidimensional arrays store multiple arrays whereas associative arrays store key-value pairs as data. Grouped relation between data can be stored in multidimensional associative arrays.
Example
<?php $my_arr = array(); $my_arr['Employee'] = array( "Name" => "Joe", "Age" => "20", "Birth_date" => "2000", "Job_details" => array( "Position" => "Manager", "Salary" => "Lakhs" ) ); print_r($my_arr['Employee']['Name']); echo "
"; echo $my_arr['Employee']['Age']; ?>
Output
Joe 20
An array is defined that contains various attributes of an employee. The employee array is accessed based on the index names and the data is displayed on the console.
- Related Articles
- Associative Arrays in PHP
- Multidimensional arrays in PHP
- What are associative Arrays in JavaScript?
- What are enumerations in Java? How to retrieve values from an enum?
- PHP Pushing values into an associative array?
- How to build dynamic associative array from simple array in php?
- Associative arrays in C++
- Multidimensional Arrays in C
- Multidimensional Arrays in C / C++
- PHP Associative Array
- How are values assigned to arrays in C#?
- How to get numeric index of associative array in PHP?
- PHP Multidimensional Array.
- How to convert Multidimensional PHP array to JavaScript array?
- Convert an object to associative array in PHP

Advertisements