#41. PHP Array_pop & Array_puch()
Array_pop :
Run Code:
<?php
$fruit = ['Apple', 'Banana', 'Mango', 'Orenge'];
// pop() for deleting
array_pop($fruit);
echo "<pre>";
print_r($fruit);
echo "</pre>";
?>
Array_puch():
<?php
$fruit = ['Apple', 'Banana', 'Mango', 'Orenge'];
// push() for Adding
array_push($fruit,"Fruta","Grapes");
echo "<pre>";
print_r($fruit);
echo "</pre>";
?>


Comments
Post a Comment