private function isChrome()
  {
    $is = false;
    // For our purposes, Chrome and Chromium are the same.
    if ( preg_match( "/(Chrome|Chromium)\/([0-9\.]+)/", $this->ua, $matches ) )
    {
      // These things go around acting like they are chrome, but they aren't.
      if ( !preg_match( "/(MRCHROME|FlyFlow|baidubrowser|bot|Edge)/i", $this->ua ) )
      {
        $is = true;
        $version = $matches[ 2 ];
        $parts = explode( '.', $matches[ 2 ] );
        $major = array_shift($parts);
        $minor = array_shift($parts);
        $rev = implode( '.', $parts );
      }
    }

    if ( $is && isset($version,$major,$minor,$rev) )
    {
      $this->browser = 'chrome';
      $this->version = $version;
      $this->major = $major;
      $this->minor = $minor;
      $this->rev = $rev;

      return true;
    }

    return false;
  }
private function isChrome()
  {
    $is = false;
    // For our purposes, Chrome and Chromium are the same.
    if ( preg_match( "/(Chrome|Chromium)\/([0-9\.]+)/", $this->ua, $matches ) )
    {
      // These things go around acting like they are chrome, but they aren't.
      if ( !preg_match( "/(MRCHROME|FlyFlow|baidubrowser|bot|Edge)/i", $this->ua ) )
      {
        $is = true;
        $version = $matches[ 2 ];
        $parts = explode( '.', $matches[ 2 ] );
        $major = array_shift($parts);
        $minor = array_shift($parts);
        $rev = implode( '.', $parts );
      }
    }

    if ( $is && isset($version,$major,$minor,$rev) )
    {
      $this->browser = 'chrome';
      $this->version = $version;
      $this->major = $major;
      $this->minor = $minor;
      $this->rev = $rev;

      return true;
    }

    return false;
  }
private function isChrome ( ) { $ is = false ; // For our purposes, Chrome and Chromium are the same. if ( preg_match ( "/(Chrome|Chromium)\/([0-9\.]+)/" , $ this -> ua , $ matches ) ) { // These things go around acting like they are chrome, but they aren't. if ( ! preg_match ( "/(MRCHROME|FlyFlow|baidubrowser|bot|Edge)/i" , $ this -> ua ) ) { $ is = true ; $ version = $ matches [ 2 ] ; $ parts = explode ( '.' , $ matches [ 2 ] ) ; $ major = array_shift ( $ parts ) ; $ minor = array_shift ( $ parts ) ; $ rev = implode ( '.' , $ parts ) ; } } if ( $ is && isset ( $ version , $ major , $ minor , $ rev ) ) { $ this -> browser = 'chrome' ; $ this -> version = $ version ; $ this -> major = $ major ; $ this -> minor = $ minor ; $ this -> rev = $ rev ; return true ; } return false ; }
Determines if a browser is chrome by the user agent string.
@return bool
Determines if a browser is chrome by the user agent string .