Ouzo\Utilities\Arrays::first PHP Метод

first() публичный статический Метод

Example: $array = array('one', 'two' 'three'); $first = Arrays::first($array); Result: one
public static first ( array $elements ) : mixed
$elements array
Результат mixed
    public static function first(array $elements)
    {
        if (empty($elements)) {
            throw new InvalidArgumentException('empty array');
        }
        return reset($elements);
    }

Usage Example

Пример #1
0
 public static function callFunction($functionName, $parameters)
 {
     $db = self::getInstance();
     $bindParams = Arrays::toArray($parameters);
     $paramsQueryString = implode(',', array_pad(array(), sizeof($bindParams), '?'));
     return Arrays::first($db->query("SELECT {$functionName}({$paramsQueryString})", $parameters)->fetch());
 }
All Usage Examples Of Ouzo\Utilities\Arrays::first