src/UserAgent.php
public static function random($filterBy = [])
    {
        $agents = self::loadUserAgents($filterBy);

        if (empty($agents)) {
            throw new \Exception('No user agents matched the filter');
        }

        return $agents[mt_rand(0, count($agents) - 1)];
    }
public static function random($filterBy = [])
    {
        $agents = self::loadUserAgents($filterBy);

        if (empty($agents)) {
            throw new \Exception('No user agents matched the filter');
        }

        return $agents[mt_rand(0, count($agents) - 1)];
    }
public static function random ( $ filterBy = [ ] ) { $ agents = self :: loadUserAgents ( $ filterBy ) ; if ( empty ( $ agents ) ) { throw new \ Exception ( 'No user agents matched the filter' ) ; } return $ agents [ mt_rand ( 0 , count ( $ agents ) - 1 ) ] ; }
Grab a random user agent from the library's agent list

@param  array $filterBy
@return string
@throws \Exception
Grab a random user agent from the library s agent list