Examveda
Examveda

What will be the output of the following PHP code?
<?php
$age = array("Peter"=>"35", "Ben"=>"37", "Joe"=>"43");
print_r(array_change_key_case($age, CASE_UPPER));
?>

A. Array ( [Peter] => 35 [Ben] => 37 [Joe] => 43 )

B. Array ( [peter] => 35 [ben] => 37 [joe] => 43 )

C. Array ( [PETER] => 35 [BEN] => 37 [JOE] => 43 )

D. Array ( [PeTeR] => 35 [BeN] => 37 [Joe] => 43 )

Answer: Option C

Solution(By Examveda Team)

The array_change_key_case() function changes all keys in an array to lowercase or uppercase.

This Question Belongs to PHP >> Arrays

Join The Discussion

Related Questions on Arrays