Unix and Linux Discussions Tagged with raspberry pi |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
4 |
8,578 |
Emergency UNIX and Linux Support |
|
|
|
7 |
2,485 |
UNIX for Beginners Questions & Answers |
|
|
|
3 |
1,385 |
Shell Programming and Scripting |
|
|
|
1 |
2,024 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
11,105 |
UNIX for Dummies Questions & Answers |
|
|
|
0 |
1,450 |
Programming |
|
|
|
1 |
4,239 |
Programming |
|
|
|
0 |
1,622 |
Programming |
|
|
|
4 |
3,241 |
Shell Programming and Scripting |
|
|
|
6 |
37,932 |
Debian |
|
|
|
4 |
3,426 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
3,215 |
Web Development |
|
|
|
4 |
3,064 |
Shell Programming and Scripting |
|
|
|
1 |
3,560 |
What is on Your Mind? |
|
|
|
0 |
3,303 |
What is on Your Mind? |
ARRAY_UNSHIFT(3) 1 ARRAY_UNSHIFT(3)
array_unshift - Prepend one or more elements to the beginning of an array
SYNOPSIS
int array_unshift (array &$array, mixed $value1, [mixed $...])
DESCRIPTION
array_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.
PARAMETERS
o $array
- The input array.
o $value1
- First value to prepend.
RETURN VALUES
Returns the new number of elements in the $array.
EXAMPLES
Example #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 ALSO
array_shift(3), array_push(3), array_pop(3).
PHP Documentation Group ARRAY_UNSHIFT(3)