ExamVeda
Login
Home
This question belongs to PHP Arrays
Arrays
?

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

Answer & Solution
Correct Answer: Option B
Treat states as a multidimensional array and accordingly traverse it to get the value.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.