The Note You're Voting On
mah dot di at live dot com ¶ 9 years ago
This removeAdd function, the first argument shift your array then unshif the second argument to your array. first argument is an array and second argument can be int or str.
<?php
function removeAdd ($arr, $newer){
$a = array_shift($arr);
$b = array_unshift($arr, $newer);
foreach ($arr as $value){
echo $value."<br />";
}
}
$a = array(1,2,3,4,5,6);
foreach ($a as $current){
echo $current."<br />";
}
echo "<hr />";
removeAdd($a, 0);
?>
OUTPUT:
1
2
3
4
5
6
_______
0
2
3
4
5
6