Query: array_unshift
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
ARRAY_UNSHIFT(3) 1 ARRAY_UNSHIFT(3) array_unshift - Prepend one or more elements to the beginning of an arraySYNOPSISint array_unshift (array &$array, mixed $value1, [mixed $...])DESCRIPTIONarray_unshift(3) prepends passed elements to the front of the $array. Note that the list of elements is prepended as a whole, so that the prepended elements stay in the same order. All numerical array keys will be modified to start counting from zero while literal keys won't be touched.PARAMETERSo $array - The input array. o $value1 - First value to prepend.RETURN VALUESReturns the new number of elements in the $array.EXAMPLESExample #1 array_unshift(3) example <?php $queue = array("orange", "banana"); array_unshift($queue, "apple", "raspberry"); print_r($queue); ?> The above example will output: Array ( [0] => apple [1] => raspberry [2] => orange [3] => banana )SEE ALSOarray_shift(3), array_push(3), array_pop(3). PHP Documentation Group ARRAY_UNSHIFT(3)
Related Man Pages |
---|
array_shift(3) - php |
array_pop(3) - php |
arsort(3) - php |
array_replace_recursive(3) - php |
print_r(3) - php |
Similar Topics in the Unix Linux Community |
---|
Identify duplicate words in a line using command |
To return the elements of array |
Signalsafe data structures |
Multiplication of array elements |
Are these Raspberry Pi kits really complete? |