Browser::getVersion PHP Method

getVersion() public method

The version of the browser.
public getVersion ( ) : string
return string Version of the browser (will only contain alpha-numeric characters and a period)
    public function getVersion()
    {
        return $this->_version;
    }

Usage Example

 function index()
 {
     include ROOT . "/library/browser/Browser.php";
     $browser = new Browser();
     if ($browser->getBrowser() == Browser::BROWSER_IE && $browser->getVersion() < 7) {
         flash_error(lang("ie browser outdated"));
     }
     if (is_ajax_request()) {
         $timezone = array_var($_GET, 'utz');
         if ($timezone && $timezone != '') {
             $usu = logged_user();
             if ($usu instanceof Contact && $usu->isUser() && !$usu->getDisabled()) {
                 $usu->setTimezone($timezone);
                 $usu->save();
             }
         }
         $this->redirectTo('dashboard', 'main_dashboard');
     } else {
         if (!(logged_user() instanceof Contact && logged_user()->isUser())) {
             $this->redirectTo('access', 'login');
         }
         $this->setLayout("website");
         $this->setTemplate(get_template_path("empty"));
     }
 }
All Usage Examples Of Browser::getVersion