This article mainly introduces how php removes the first element of an array through the array_shift () function. It involves the array_shift () function Operation Array Technique in php and has some reference value, for more information, see
This article mainly introduces how php removes the first element of an array through the array_shift () function. It involves the array_shift () function Operation Array Technique in php and has some reference value, for more information, see
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.
,