What will be the output of the following php code?
$states = array("karnataka" => array( "population" => "11,35,000", "captial" => "Bangalore"),"Tamil Nadu" => array( "population" => "17,90,000","captial" => "Chennai") );
echo $states["karnataka"]["population"];

A. karnataka 11,35,000

B. 11,35,000

C. population 11,35,000

D. karnataka population

Answer: Option B

Solution(By Examveda Team)

Treat states as a multidimensional array and accordingly traverse it to get the value.

This Question Belongs to PHP >> Arrays

Join The Discussion

Related Questions on Arrays