90 of 110 menu

Removing the First Element of an Array in PHP

To remove the first element of an array, the function array_shift is used. See the example:

<?php $arr = [1, 2, 3, 4, 5]; array_shift($arr); var_dump($arr); ?>

Code execution result:

[2, 3, 4, 5]
English
БеларускаяEspañolРусский
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline