how do i move an element of an array to a different location? for example,
i have an array array(1,2,3,4,5,6)
and i want to move the 3 after the for so it ends up as array(1,2,4,3,5,6)
how is this done???
Moving elements of an array?
Moderator: General Moderators
- harrisonad
- Forum Contributor
- Posts: 288
- Joined: Fri Oct 15, 2004 4:58 am
- Location: Philippines
- Contact:
simple manual solution
Code: Select all
$x = $aray[4];
$aray[4] = $aray[3];
$aray[3] = $x;