Created
February 3, 2015 02:44
-
-
Save rightgo09/6e6301adc0928cc3f9b4 to your computer and use it in GitHub Desktop.
array_shiftした後の配列は添字がちゃんと0から始まる.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $arr = array(4,1,3); | |
| print_r($arr); | |
| $a = array_shift($arr); | |
| print_r($arr); | |
| array_unshift($arr, $a); | |
| print_r($arr); | |
| //Array | |
| //( | |
| // [0] => 4 | |
| // [1] => 1 | |
| // [2] => 3 | |
| //) | |
| //Array | |
| //( | |
| // [0] => 1 | |
| // [1] => 3 | |
| //) | |
| //Array | |
| //( | |
| // [0] => 4 | |
| // [1] => 1 | |
| // [2] => 3 | |
| //) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment