Copyright 2013, Gabriel Bull, Licensed under the GNU GENERAL PUBLIC LICENSE.
This project is a fork of Chris Schuld's browser.php.
Detecting the user's browser, operating system and language from PHP. Because browser detection is not always reliable and evolves at all time, use with care and feel free to contribute.
The Browser class allow you to detect a user's browser and version.
- Opera
- Opera Mini
- WebTV
- Internet Explorer
- Pocket Internet Explorer
- Konqueror
- iCab
- OmniWeb
- Firebird
- Firefox
- Iceweasel
- Shiretoko
- Mozilla
- Amaya
- Lynx
- Safari
- iPhone
- iPod
- iPad
- Chrome
- Navigator
- GoogleBot
- Yahoo! Slurp
- W3C Validator
- BlackBerry
- IceCat
- Nokia S60 OSS Browser
- Nokia Browser
- MSN Browser
- MSN Bot
- Netscape Navigator
- Galeon
- NetPositive
- Phoenix
- SeaMonkey
if (Browser\Browser::getBrowser() === Browser\Browser::IE && Browser\Browser::getVersion() < 8) {
echo 'Please upgrade your browser.';
}
The OS class allow you to detect a user's operating system and version.
- Windows
- OS X
- iOS
- Android
- Linux
- SymbOS
- Nokia
- BlackBerry
- FreeBSD
- OpenBSD
- NetBSD
- OpenSolaris
- SunOS
- OS2
- BeOS
if (Browser\OS::getOS() == Browser\OS::IOS) {
echo 'You are using an iOS device.';
}
The Language class allow you to detect a user's language.
if (Browser\Language::getLanguage() == 'de') {
echo 'Get this website in german.';
}