Php uses the array_shift () function to remove the first element of the array. array_shift is removed. Php uses the array_shift () function to remove the first element of the array. the array_shift function removes the first element of the array in php. Share with php the method of removing the first element of the array through the array_shift () function, and remove array_shift
This example describes how php removes the first element of an array through the array_shift () function. Share it with you for your reference. The specific analysis is as follows:
The following code uses the array_shift () function and the while loop to remove the first element of the array until the array is empty.
<? Php $ alpha = array ("a", "B", "c"); while (count ($ alpha) {$ val = array_shift ($ alpha ); print "$ val
"; Print" there are ". count ($ alpha)." elements in \ $ alpha
";}?>
I hope this article will help you with php programming.
The trim () function removes the first element of the array. the array_shift function removes the first element of the array in php. Share...