swap
Swaps two fields of a field array by their index.
swap(form, name, options);
Parameters
formFormStorenamestringoptionsobjectatnumberandnumber
Explanation
With at and and you define the indexes of the items to be swapped. The action is executed only if both indexes are valid.