Skip to content

PHP code snippet – How to remove first element in array ?

<?php
$stack = array("orange", "banana", "apple", "raspberry");
$fruit = array_shift($stack);
print_r($stack);
?>


// Array
// (
//     [0] => banana
//     [1] => apple
//     [2] => raspberry
// )
See also  Java code snippet - How to put icons inside of an edittext android?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.