Hello Readers ,
With the use of array_unshift() , it will insert new values at the beginning of an array.
We can add one value, or as many as you like.
Syntax:
array_unshift(array,value1,value2,value3...)
Example:
<?php
$a=array("a"=>"red","b"=>"green");
array_unshift($a,"blue");
print_r($a);
?>
Output:
Array ( [0] => blue [a] => red [b] => green )
0 Comment(s)