a::last($array)

Returns the last element of an array

  • $array (array)
    The source array
  • return (mixed)
    The last element

Example

<?php
$array = array(
  'cat',
  'dog',
  'bird',
);
$last = a::last($array);
var_dump($last);

Result:

'bird'

Is something missing or incorrect? Edit this page on Github…