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
Examples
$array = [
'cat' => 'miao',
'dog' => 'wuff',
'bird' => 'tweet'
];