A::first()
Returns the first element of an array
A::first(array $array): mixed
Parameters
Name | Type | Default | Description |
---|---|---|---|
$arrayrequired | array |
no default value | The source array |
Return type
mixed
The first element
Parent class
Examples
$array = [
'cat' => 'miao',
'dog' => 'wuff',
'bird' => 'tweet'
];