Maybe there is a more elegant solution or there is a special function for this. Then my colleagues will surely correct me, but for now use this working option:
$mylist2 = array(1,2,3,4,5,6,7);
$count = count($mylist2);
$newArray = array();
foreach ( $mylist2 as $key => $value ) {
if ( ($count-1) == $key ) {
$newArray[0] = $value;
} else {
$newArray[$key+1] = $value;
}
}
ksort($newArray);
var_dump(implode(", ", $newArray));