What would be a good way of fliping key 1 with key 2?
// original
Array
(
[0] => Text1
[1] => World
[2] => Hello
)
// after
Array
(
[0] => Text1
[1] => Hello
[2] => World
)
Any clues. Thanks
What would be a good way of fliping key 1 with key 2?
// original
Array
(
[0] => Text1
[1] => World
[2] => Hello
)
// after
Array
(
[0] => Text1
[1] => Hello
[2] => World
)
Any clues. Thanks
If it's a simple as that,
$tmp = $array[1];
$array[1] = $array[2];
$array[2] = $tmp;
$A = array("Text1", "Hello", "World");
$tmp = $A[2];
$A[2] = $A[1];
$A[1] = $tmp;