-
What will be the output of the following PHP code?
<?php
$City = array("A"=>"Chennai", "B"=>"Noida", "C"=>"Delhi");
echo array_shift($City);
print_r ($City);
?>
-
-
ChennaiArray
(
[C] => Delhi
) -
ChennaiArray
(
[B] => Noida
[C] => Delhi
) -
Array
(
[B] => Noida
[C] => Delhi
) -
ChennaiArray
(
Noida
Delhi
) - None of these
-
Correct Option: B
The array_shift() function removes the first element from an array, and returns the value of the removed element.