70 of 110 menu

The Last Element of an Array in PHP

To output the last element of an array, the array_pop function is used. See the example:

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

Code execution result:

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