Skip to content

Kirby 5.0.4

A::last()

Returns the last element of an array

A::last(array $array): mixed

Parameters

Name Type Default Description
$arrayrequired array no default value The source array

Return type

mixed

The last element

Parent class

Kirby\Toolkit\A

Examples

$array = [
  'cat'  => 'miao',
  'dog'  => 'wuff',
  'bird' => 'tweet'
];