- array_unshift: documentation ( source)
- print_r: documentation ( source)
- array_pop: documentation ( source)
<?php
$a = [1,2,3,4,5];
function array_pop_unshift($array) {
array_unshift($array, array_pop($array));
return $array;
}
print_r(array_pop_unshift($a));