JBZoo\Utils\Arr::first PHP Method

first() public static method

Returns the first element in an array.
public static first ( array $array ) : mixed
$array array
return mixed
    public static function first(array $array)
    {
        return reset($array);
    }

Usage Example

示例#1
0
文件: ArrayTest.php 项目: jbzoo/utils
 public function testFirst()
 {
     $test = array('a' => array('a', 'b', 'c'));
     is('a', Arr::first(Vars::get($test['a'])));
 }