PHP 2 Flashcards

1
Q

What does

$a=array(“red”,”green”,”blue”);
array_pop($a)

do?

A

Delete last element of an array

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does

$a=array(“red”,”green”,”blue”);
array_shift($a)

do?

A

array_shift() deletes first element of an array.

To return this use array_unshift()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly