Vidyalelo
PHP · Q34

Arrays

Programming · PHP · question 34

Q34

What will be the output of the following PHP code? "red", "b"=>"green", "c"=>"blue"); echo array_shift( a); print_r ( a); ?>

A.
green
B.
red
Answer
C.
blue
D.
none of the mentioned

Answer: Option B

Solution

Answer: Option B
Solution:
The array_shift() function removes the first element from an array, and returns the value of the removed element.