?
What will be the output of the following PHP code?
What will be the output of the following PHP code?
<?php
$a = array("a"=>"red", "b"=>"green", "c"=>"blue");
echo array_shift($a);
print_r ($a);
?>
<?php
$a = array("a"=>"red", "b"=>"green", "c"=>"blue");
echo array_shift($a);
print_r ($a);
?>
Answer & Solution
Correct Answer:
Option
B
The array_shift() function removes the first element from an array, and returns the value of the removed element.
Join the Discussion
Login to post a comment or share your explanation.
Login