[ create a new paste ] login | about

Link: http://codepad.org/cWZHjJwy    [ raw code | output | fork ]

PHP, pasted on Oct 31:
1
2
3
4
5
6
7
8
9
<?php

$array = array(1,2,3,4,5,6,7);

$element = $array[4];
unset($array[4]);
$array[] = $element;

print_r($array);


Output:
1
2
3
4
5
6
7
8
9
10
Array
(
    [0] => 1
    [1] => 2
    [2] => 3
    [3] => 4
    [5] => 6
    [6] => 7
    [7] => 5
)


Create a new paste based on this one


Comments: