Examveda
Examveda

What will be the output of the following PHP code ?
<?php
$age = array("Harry" => "21", "Ron" => "23","Malfoy" => "21");
array_change_key_case($age, CASE_UPPER);
array_pop($age);
print_r($age);
?>

A. Array ( [Harry] => 21 [Ron] => 23 [Malfoy] => 21 )

B. Array ( [HARRY] => 21 [RON] => 23 [MALFOY] => 21 )

C. Array ( [HARRY] => 21 [RON] => 23 )

D. Array ( [Harry] => 21 [Ron] => 23 )

Answer: Option C

Solution(By Examveda Team)

The array_change_key_case() function changes all keys in an array to lowercase or uppercase and arry_pop() removes last element

This Question Belongs to PHP >> Arrays

Join The Discussion

Related Questions on Arrays