21.
What will be the output of the following PHP code?
<?php
$colors = array("Red" => 1, "Green" => 2, "Blue" => 3);
asort($colors);
foreach ($colors as $color => $value) {
echo "$color: $value ";
}
?
22.
What is the purpose of the array_key_exists() function in PHP?
23.
What will be the output of the following PHP code?
<?php
$info = array("name" => "John", "age" => 30, "city" => "New York");
echo array_key_exists("age", $info) ? "Yes" : "No";
?