I\'m looking for a simple function to move an array element to a new position in the array and resequence the indexes so that there are no gaps in the sequence. It doesnt ne
You need to create an auxiliary variable.
moveElement($a, $i,$j) { $k=$a[$i]; $a[$i]=$a[$j]; $a[$j]=$k; return $a; }