a::first($array)

Returns the first element of an array

  • $array (array)
    The source array
  • return (mixed)
    The first element

Example

<?php
$array = array(
  'cat',
  'dog',
  'bird',
);
$first = a::first($array);
var_dump($first);

Result:

'cat'