#42. PHP Array_shift & Array_unshift
PHP Array_shift :
<?php
$fruit = ['Apple', 'Banana', 'Mango', 'Orenge'];
// Using for Arr shift remove 1st value
array_shift($fruit);
echo "<pre>";
print_r($fruit);
echo "</pre>";
?>
Run Code:
<?php
$fruit = ['Apple', 'Banana', 'Mango', 'Orenge'];
// Using for Arr Unshift add 1st value
array_unshift($fruit, "Grapes");
echo "<pre>";
print_r($fruit);
echo "</pre>";
?>


Comments
Post a Comment