Show Output
Example of Accessing a Value from PHP Array
"Paris", "India"=>"Mumbai", "UK"=>"London", "USA"=>"New York"); // Multidimensional array $superheroes = array( array( "name" => "Peter Parker", "character" => "Spider-Man", ), array( "name" => "Tony Stark", "character" => "Iron-Man", ), array( "name" => "Clark Kent", "character" => "Super-Man", ) ); echo $sports[0]; // Outputs: Baseball echo "
"; echo $sports[1]; // Outputs: Cricket echo "
"; echo $cities["France"]; // Outputs: Paris echo "
"; echo $cities["USA"]; // Outputs: New York echo "
"; echo $superheroes[0]["name"]; // Outputs: Peter Parker echo "
"; echo $superheroes[1]["character"]; // Outputs: Iron-Man ?>