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'