array_unshift

It prepend one or more elements to the beginning of an array

Example

<?php
echo “<pre>”;
$array = array(“PHP”, “ASP”);
($array, “JS”, “AS”);
print_r($array);
?>

Output

Array
(
[0] => JS
[1] => AS
[2] => PHP
[3] => ASP
)

Share