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