Programming Language › Arrays in PHP MCQ › Question #2382
Single Choice Not Set

QWhat 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"];
?>

ID: #2382 Arrays in PHP MCQ 918 views
Question Info
#2382Q ID
Not SetDifficulty
Arrays in PHP MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A karnataka 11,35,000 ✔ ✖
  • B 11,35,000 ✔ ✖
  • C population 11,35,000 ✔ ✖
  • D karnataka population ✔ ✖
Correct Answer

Explanation

Treat states as a multidimensional array and accordingly traverse it to get the value.
Today: 0 answered · 0 correct
Save progress
Free account

Want to remember what you got wrong?

Create a free account in seconds to track your score, revisit mistakes and continue Programming Language where you left off.

  • Save your progress & streak
  • Topic-wise quizzes & scores
  • Bookmark tricky questions
  • Printable MCQ sets
Practice smarterFree account · save progress
Sign up free

Share This Question

Challenge a friend or share with your study group.