php inserted into the first insertion and tail arrays

Insert the first place:

<?php
$queue = array("orange", "banana");
array_unshift($queue, "apple", "raspberry");
print_r($queue);
?>

Array
(
    [0] => apple
    [1] => raspberry
    [2] => orange
    [3] => banana
)




尾部插入:
<?php
$stack = array("orange", "banana");
array_push($stack, "apple", "raspberry");
print_r($stack);
?>
Array
(
    [0] => orange
    [1] => banana
    [2] => apple
    [3] => raspberry
)



Guess you like

Origin www.cnblogs.com/qcjdp/p/11766429.html