public function parse($userAgentString = null)
  {
    // use current user agent string as default
    if(!$userAgentString)
    {
      $userAgentString = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : null;
    }

    // parse quickly (with medium accuracy)
    $informations = $this->doParse($userAgentString);


    // run some filters to increase accuracy
    foreach($this->getFilters() as $filter)
    {
      $this->$filter($informations);
    }

    return $informations;
  }
public function parse($userAgentString = null)
  {
    // use current user agent string as default
    if(!$userAgentString)
    {
      $userAgentString = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : null;
    }

    // parse quickly (with medium accuracy)
    $informations = $this->doParse($userAgentString);


    // run some filters to increase accuracy
    foreach($this->getFilters() as $filter)
    {
      $this->$filter($informations);
    }

    return $informations;
  }
public function parse ( $ userAgentString = null ) { // use current user agent string as default if ( ! $ userAgentString ) { $ userAgentString = isset ( $ _SERVER [ 'HTTP_USER_AGENT' ] ) ? $ _SERVER [ 'HTTP_USER_AGENT' ] : null ; } // parse quickly (with medium accuracy) $ informations = $ this -> doParse ( $ userAgentString ) ; // run some filters to increase accuracy foreach ( $ this -> getFilters ( ) as $ filter ) { $ this -> $ filter ( $ informations ) ; } return $ informations ; }
Parse a user agent string.

@param   string  $userAgentString  defaults to $_SERVER['HTTP_USER_AGENT'] if empty
@return  array   (                 the user agent informations
'browser_name'      => 'firefox',
'browser_version'   => '3.6',
'operating_system'  => 'linux'
)
Parse a user agent string .