
Multidimensional Array is Arrays of Array means one arrays have multiple array. You can define as it have 2Dimensional ([][]), 3Dimensional ([][][]), 4Dimensional ([][][]), and etc.
ex:-
<?php | |
$a [0][] = "name"; | |
$a [0][] = "name1"; | |
$a [0][] = "name2"; | |
echo $a[0][1]; | |
echo "<br>"; | |
$b [0][0][0] = "value"; | |
$b [0][0][1] = "value1"; | |
echo $b[0][0][1]; | |
echo "<br>"; | |
$c = array ( | |
"value" => array ("cost" => 10, "first"=> 20, "second" => 30), | |
"value1" => array ("cost" => 100, "first"=> 200, "second" => 300), | |
"value2" => array ("cost" => 1000, "first"=> 2000, "second" => 3000), | |
"value3" => array ("cost" => 10000, "first"=> 20000, "second" => 30000) | |
); | |
echo $c["value"]["cost"]; | |
echo "<br>"; | |
echo $c["value1"]["second"]; | |
echo "<br>"; | |
echo $c["value3"]["first"]; | |
echo "<br>"; | |
?> |
How to work:-
In this array first row or index or key any value necessary but second value not necessary to define. It can be created using nested array.




I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I am working at Cotocus. I blog tech insights at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at I reviewed , and SEO strategies at Wizbrand.
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at PINTEREST
Rajesh Kumar at QUORA
Rajesh Kumar at WIZBRAND