$numbers = array(1,2,3,4);
array_push($numbers, array_shift($numbers));
print_r($numbers);
Output
Array
(
[0] => 2
[1] => 3
[2] => 4
[3] => 1
)
More Related Contents:
- Perform logic operations on boolean array values
- Can I bind an array to an IN() condition in a PDO query?
- PHP Constants Containing Arrays?
- How to Remove Array Element and Then Re-Index Array?
- Count number of values in array with a given value
- PHP Foreach Pass by Reference: Last Element Duplicating? (Bug?) [duplicate]
- Which is faster in PHP, $array[] = $value or array_push($array, $value)?
- How do I sort a multidimensional array by one of the fields of the inner array in PHP? [duplicate]
- PHP: merge two arrays while keeping keys instead of reindexing?
- How to check if an array value exists?
- A formula to find prime numbers in a loop
- in_array multiple values
- Notice: Array to string conversion in
- php array behaving strangely with key value 07 & 08
- multidimensional array array_sum
- Removing array item by value [duplicate]
- How to allow duplicate keys in php array [duplicate]
- PHP how to retrieve array values
- How do I `json_encode()` keys from PHP array?
- Add a prefix to each item of a PHP array
- Notice: Undefined index when trying to increment an associative array in PHP
- PHP – Get key name of array value
- What is the max key size for an array in PHP?
- Split array into a specific number of chunks
- Sort array by value alphabetically php
- CMS Routing in MVC
- Best way to initialize (empty) array in PHP
- Change array key without changing order
- Recursive array_search
- Conditionally add associative element to array