Answers for "php shift the last array element to first"

PHP
2

php array move first element to last

$array = array("PHP", "JS", "JAVA");
$first_element = array_shift($array);
$array[count($array) + 1] = $first_element;
print_r($array);
Posted by: Guest on June-09-2021

Code answers related to "php shift the last array element to first"

Browse Popular Code Answers by Language