I tried to search in google but cannot find a complete solution (i only find something detects only the browser\'s type like firefox, opera) .
i want a php class or
I used the techpatterns.com one and they don't always update it and it use procedural code which feel dated...
The Wolfcast BrowserDetection PHP class is updated and use an Object-Oriented way to do it:
You use it this way:
$browser = new BrowserDetection();
echo 'You are using ', $browser->getBrowser(), ' version ', $browser->getVersion();
Another example:
$browser = new BrowserDetection();
if ($browser->getBrowser() == BrowserDetection::BROWSER_FIREFOX && $browser->compareVersions($browser->getVersion(), '5.0.1') !== 1) {
echo 'You have FireFox version 5.0.1 or greater. ';
}