\Browser

File: Browser.php Author: Chris Schuld (http://chrisschuld.com/) Last Modified: August 20th, 2010

Summary

Methods
Properties
Constants
__construct()
reset()
isBrowser()
getBrowser()
setBrowser()
getPlatform()
setPlatform()
getVersion()
setVersion()
getAolVersion()
setAolVersion()
isAol()
isMobile()
isRobot()
setAol()
getUserAgent()
setUserAgent()
isChromeFrame()
__toString()
No public properties found
BROWSER_UNKNOWN
VERSION_UNKNOWN
BROWSER_OPERA
BROWSER_OPERA_MINI
BROWSER_WEBTV
BROWSER_IE
BROWSER_POCKET_IE
BROWSER_KONQUEROR
BROWSER_ICAB
BROWSER_OMNIWEB
BROWSER_FIREBIRD
BROWSER_FIREFOX
BROWSER_ICEWEASEL
BROWSER_SHIRETOKO
BROWSER_MOZILLA
BROWSER_AMAYA
BROWSER_LYNX
BROWSER_SAFARI
BROWSER_IPHONE
BROWSER_IPOD
BROWSER_IPAD
BROWSER_CHROME
BROWSER_ANDROID
BROWSER_GOOGLEBOT
BROWSER_SLURP
BROWSER_W3CVALIDATOR
BROWSER_BLACKBERRY
BROWSER_ICECAT
BROWSER_NOKIA_S60
BROWSER_NOKIA
BROWSER_MSN
BROWSER_MSNBOT
BROWSER_NETSCAPE_NAVIGATOR
BROWSER_GALEON
BROWSER_NETPOSITIVE
BROWSER_PHOENIX
PLATFORM_UNKNOWN
PLATFORM_WINDOWS
PLATFORM_WINDOWS_CE
PLATFORM_APPLE
PLATFORM_LINUX
PLATFORM_OS2
PLATFORM_BEOS
PLATFORM_IPHONE
PLATFORM_IPOD
PLATFORM_IPAD
PLATFORM_WINOS
PLATFORM_BLACKBERRY
PLATFORM_NOKIA
PLATFORM_FREEBSD
PLATFORM_OPENBSD
PLATFORM_NETBSD
PLATFORM_SUNOS
PLATFORM_OPENSOLARIS
PLATFORM_ANDROID
OPERATING_SYSTEM_UNKNOWN
setMobile()
setRobot()
determine()
checkBrowsers()
checkBrowserBlackBerry()
checkForAol()
checkBrowserGoogleBot()
checkBrowserMSNBot()
checkBrowserW3CValidator()
checkBrowserSlurp()
checkBrowserInternetExplorer()
checkBrowserOpera()
checkBrowserChrome()
checkBrowserWebTv()
checkBrowserNetPositive()
checkBrowserGaleon()
checkBrowserKonqueror()
checkBrowserIcab()
checkBrowserOmniWeb()
checkBrowserPhoenix()
checkBrowserFirebird()
checkBrowserNetscapeNavigator9Plus()
checkBrowserShiretoko()
checkBrowserIceCat()
checkBrowserNokia()
checkBrowserFirefox()
checkBrowserIceweasel()
checkBrowserMozilla()
checkBrowserLynx()
checkBrowserAmaya()
checkBrowserSafari()
checkBrowseriPhone()
checkBrowseriPad()
checkBrowserWinOS()
checkBrowseriPod()
checkBrowserAndroid()
checkPlatform()
No protected properties found
N/A
No private methods found
$_agent
$_browser_name
$_version
$_platform
$_os
$_is_aol
$_is_mobile
$_is_robot
$_aol_version
N/A

Constants

BROWSER_UNKNOWN

BROWSER_UNKNOWN

VERSION_UNKNOWN

VERSION_UNKNOWN

BROWSER_OPERA

BROWSER_OPERA

BROWSER_OPERA_MINI

BROWSER_OPERA_MINI

BROWSER_WEBTV

BROWSER_WEBTV

BROWSER_IE

BROWSER_IE

BROWSER_POCKET_IE

BROWSER_POCKET_IE

BROWSER_KONQUEROR

BROWSER_KONQUEROR

BROWSER_ICAB

BROWSER_ICAB

BROWSER_OMNIWEB

BROWSER_OMNIWEB

BROWSER_FIREBIRD

BROWSER_FIREBIRD

BROWSER_FIREFOX

BROWSER_FIREFOX

BROWSER_ICEWEASEL

BROWSER_ICEWEASEL

BROWSER_SHIRETOKO

BROWSER_SHIRETOKO

BROWSER_MOZILLA

BROWSER_MOZILLA

BROWSER_AMAYA

BROWSER_AMAYA

BROWSER_LYNX

BROWSER_LYNX

BROWSER_SAFARI

BROWSER_SAFARI

BROWSER_IPHONE

BROWSER_IPHONE

BROWSER_IPOD

BROWSER_IPOD

BROWSER_IPAD

BROWSER_IPAD

BROWSER_CHROME

BROWSER_CHROME

BROWSER_ANDROID

BROWSER_ANDROID

BROWSER_GOOGLEBOT

BROWSER_GOOGLEBOT

BROWSER_SLURP

BROWSER_SLURP

BROWSER_W3CVALIDATOR

BROWSER_W3CVALIDATOR

BROWSER_BLACKBERRY

BROWSER_BLACKBERRY

BROWSER_ICECAT

BROWSER_ICECAT

BROWSER_NOKIA_S60

BROWSER_NOKIA_S60

BROWSER_NOKIA

BROWSER_NOKIA

BROWSER_MSN

BROWSER_MSN

BROWSER_MSNBOT

BROWSER_MSNBOT

BROWSER_NETSCAPE_NAVIGATOR

BROWSER_NETSCAPE_NAVIGATOR

BROWSER_GALEON

BROWSER_GALEON

BROWSER_NETPOSITIVE

BROWSER_NETPOSITIVE

BROWSER_PHOENIX

BROWSER_PHOENIX

PLATFORM_UNKNOWN

PLATFORM_UNKNOWN

PLATFORM_WINDOWS

PLATFORM_WINDOWS

PLATFORM_WINDOWS_CE

PLATFORM_WINDOWS_CE

PLATFORM_APPLE

PLATFORM_APPLE

PLATFORM_LINUX

PLATFORM_LINUX

PLATFORM_OS2

PLATFORM_OS2

PLATFORM_BEOS

PLATFORM_BEOS

PLATFORM_IPHONE

PLATFORM_IPHONE

PLATFORM_IPOD

PLATFORM_IPOD

PLATFORM_IPAD

PLATFORM_IPAD

PLATFORM_WINOS

PLATFORM_WINOS

PLATFORM_BLACKBERRY

PLATFORM_BLACKBERRY

PLATFORM_NOKIA

PLATFORM_NOKIA

PLATFORM_FREEBSD

PLATFORM_FREEBSD

PLATFORM_OPENBSD

PLATFORM_OPENBSD

PLATFORM_NETBSD

PLATFORM_NETBSD

PLATFORM_SUNOS

PLATFORM_SUNOS

PLATFORM_OPENSOLARIS

PLATFORM_OPENSOLARIS

PLATFORM_ANDROID

PLATFORM_ANDROID

OPERATING_SYSTEM_UNKNOWN

OPERATING_SYSTEM_UNKNOWN

Properties

$_agent

$_agent

$_browser_name

$_browser_name

$_version

$_version

$_platform

$_platform

$_os

$_os

$_is_aol

$_is_aol

$_is_mobile

$_is_mobile

$_is_robot

$_is_robot

$_aol_version

$_aol_version

Methods

__construct()

__construct( $useragent)

Parameters

$useragent

reset()

reset()

Reset all properties

isBrowser()

isBrowser(string $browserName) : True

Check to see if the specific browser is valid

Parameters

string $browserName

Returns

True —

if the browser is the specified browser

getBrowser()

getBrowser() : string

The name of the browser. All return types are from the class contants

Returns

string —

Name of the browser

setBrowser()

setBrowser(mixed $browser)

Set the name of the browser

Parameters

mixed $browser

The name of the Browser

getPlatform()

getPlatform() : string

The name of the platform. All return types are from the class contants

Returns

string —

Name of the browser

setPlatform()

setPlatform(mixed $platform)

Set the name of the platform

Parameters

mixed $platform

The name of the Platform

getVersion()

getVersion() : string

The version of the browser.

Returns

string —

Version of the browser (will only contain alpha-numeric characters and a period)

setVersion()

setVersion(mixed $version)

Set the version of the browser

Parameters

mixed $version

The version of the Browser

getAolVersion()

getAolVersion() : string

The version of AOL.

Returns

string —

Version of AOL (will only contain alpha-numeric characters and a period)

setAolVersion()

setAolVersion(mixed $version)

Set the version of AOL

Parameters

mixed $version

The version of AOL

isAol()

isAol() : boolean

Is the browser from AOL?

Returns

boolean —

True if the browser is from AOL otherwise false

isMobile()

isMobile() : boolean

Is the browser from a mobile device?

Returns

boolean —

True if the browser is from a mobile device otherwise false

isRobot()

isRobot() : boolean

Is the browser from a robot (ex Slurp,GoogleBot)?

Returns

boolean —

True if the browser is from a robot otherwise false

setAol()

setAol(mixed $isAol)

Set the browser to be from AOL

Parameters

mixed $isAol

getUserAgent()

getUserAgent() : string

Get the user agent value in use to determine the browser

Returns

string —

The user agent from the HTTP header

setUserAgent()

setUserAgent(mixed $agent_string)

Set the user agent value (the construction will use the HTTP header value - this will overwrite it)

Parameters

mixed $agent_string

The value for the User Agent

isChromeFrame()

isChromeFrame() : boolean

Used to determine if the browser is actually "chromeframe"

Returns

boolean —

True if the browser is using chromeframe

__toString()

__toString() : string

Returns a formatted string with a summary of the details of the browser.

Returns

string —

formatted string with a summary of the browser

setMobile()

setMobile(boolean $value)

Set the Browser to be mobile

Parameters

boolean $value

is the browser a mobile brower or not

setRobot()

setRobot(boolean $value)

Set the Browser to be a robot

Parameters

boolean $value

is the browser a robot or not

determine()

determine()

Protected routine to calculate and determine what the browser is in use (including platform)

checkBrowsers()

checkBrowsers() : boolean

Protected routine to determine the browser type

Returns

boolean —

True if the browser was detected otherwise false

checkBrowserBlackBerry()

checkBrowserBlackBerry() : boolean

Determine if the user is using a BlackBerry (last updated 1.7)

Returns

boolean —

True if the browser is the BlackBerry browser otherwise false

checkForAol()

checkForAol() : boolean

Determine if the user is using an AOL User Agent (last updated 1.7)

Returns

boolean —

True if the browser is from AOL otherwise false

checkBrowserGoogleBot()

checkBrowserGoogleBot() : boolean

Determine if the browser is the GoogleBot or not (last updated 1.7)

Returns

boolean —

True if the browser is the GoogletBot otherwise false

checkBrowserMSNBot()

checkBrowserMSNBot() : boolean

Determine if the browser is the MSNBot or not (last updated 1.9)

Returns

boolean —

True if the browser is the MSNBot otherwise false

checkBrowserW3CValidator()

checkBrowserW3CValidator() : boolean

Determine if the browser is the W3C Validator or not (last updated 1.7)

Returns

boolean —

True if the browser is the W3C Validator otherwise false

checkBrowserSlurp()

checkBrowserSlurp() : boolean

Determine if the browser is the Yahoo! Slurp Robot or not (last updated 1.7)

Returns

boolean —

True if the browser is the Yahoo! Slurp Robot otherwise false

checkBrowserInternetExplorer()

checkBrowserInternetExplorer() : boolean

Determine if the browser is Internet Explorer or not (last updated 1.7)

Returns

boolean —

True if the browser is Internet Explorer otherwise false

checkBrowserOpera()

checkBrowserOpera() : boolean

Determine if the browser is Opera or not (last updated 1.7)

Returns

boolean —

True if the browser is Opera otherwise false

checkBrowserChrome()

checkBrowserChrome() : boolean

Determine if the browser is Chrome or not (last updated 1.7)

Returns

boolean —

True if the browser is Chrome otherwise false

checkBrowserWebTv()

checkBrowserWebTv() : boolean

Determine if the browser is WebTv or not (last updated 1.7)

Returns

boolean —

True if the browser is WebTv otherwise false

checkBrowserNetPositive()

checkBrowserNetPositive() : boolean

Determine if the browser is NetPositive or not (last updated 1.7)

Returns

boolean —

True if the browser is NetPositive otherwise false

checkBrowserGaleon()

checkBrowserGaleon() : boolean

Determine if the browser is Galeon or not (last updated 1.7)

Returns

boolean —

True if the browser is Galeon otherwise false

checkBrowserKonqueror()

checkBrowserKonqueror() : boolean

Determine if the browser is Konqueror or not (last updated 1.7)

Returns

boolean —

True if the browser is Konqueror otherwise false

checkBrowserIcab()

checkBrowserIcab() : boolean

Determine if the browser is iCab or not (last updated 1.7)

Returns

boolean —

True if the browser is iCab otherwise false

checkBrowserOmniWeb()

checkBrowserOmniWeb() : boolean

Determine if the browser is OmniWeb or not (last updated 1.7)

Returns

boolean —

True if the browser is OmniWeb otherwise false

checkBrowserPhoenix()

checkBrowserPhoenix() : boolean

Determine if the browser is Phoenix or not (last updated 1.7)

Returns

boolean —

True if the browser is Phoenix otherwise false

checkBrowserFirebird()

checkBrowserFirebird() : boolean

Determine if the browser is Firebird or not (last updated 1.7)

Returns

boolean —

True if the browser is Firebird otherwise false

checkBrowserNetscapeNavigator9Plus()

checkBrowserNetscapeNavigator9Plus() : boolean

Determine if the browser is Netscape Navigator 9+ or not (last updated 1.7) NOTE: (http://browser.netscape.com/ - Official support ended on March 1st, 2008)

Returns

boolean —

True if the browser is Netscape Navigator 9+ otherwise false

checkBrowserShiretoko()

checkBrowserShiretoko() : boolean

Determine if the browser is Shiretoko or not (https://wiki.mozilla.org/Projects/shiretoko) (last updated 1.7)

Returns

boolean —

True if the browser is Shiretoko otherwise false

checkBrowserIceCat()

checkBrowserIceCat() : boolean

Determine if the browser is Ice Cat or not (http://en.wikipedia.org/wiki/GNU_IceCat) (last updated 1.7)

Returns

boolean —

True if the browser is Ice Cat otherwise false

checkBrowserNokia()

checkBrowserNokia() : boolean

Determine if the browser is Nokia or not (last updated 1.7)

Returns

boolean —

True if the browser is Nokia otherwise false

checkBrowserFirefox()

checkBrowserFirefox() : boolean

Determine if the browser is Firefox or not (last updated 1.7)

Returns

boolean —

True if the browser is Firefox otherwise false

checkBrowserIceweasel()

checkBrowserIceweasel() : boolean

Determine if the browser is Firefox or not (last updated 1.7)

Returns

boolean —

True if the browser is Firefox otherwise false

checkBrowserMozilla()

checkBrowserMozilla() : boolean

Determine if the browser is Mozilla or not (last updated 1.7)

Returns

boolean —

True if the browser is Mozilla otherwise false

checkBrowserLynx()

checkBrowserLynx() : boolean

Determine if the browser is Lynx or not (last updated 1.7)

Returns

boolean —

True if the browser is Lynx otherwise false

checkBrowserAmaya()

checkBrowserAmaya() : boolean

Determine if the browser is Amaya or not (last updated 1.7)

Returns

boolean —

True if the browser is Amaya otherwise false

checkBrowserSafari()

checkBrowserSafari() : boolean

Determine if the browser is Safari or not (last updated 1.7)

Returns

boolean —

True if the browser is Safari otherwise false

checkBrowseriPhone()

checkBrowseriPhone() : boolean

Determine if the browser is iPhone or not (last updated 1.7)

Returns

boolean —

True if the browser is iPhone otherwise false

checkBrowseriPad()

checkBrowseriPad() : boolean

Determine if the browser is iPod or not (last updated 1.7)

Returns

boolean —

True if the browser is iPod otherwise false

checkBrowserWinOS()

checkBrowserWinOS()

checkBrowseriPod()

checkBrowseriPod() : boolean

Determine if the browser is iPod or not (last updated 1.7)

Returns

boolean —

True if the browser is iPod otherwise false

checkBrowserAndroid()

checkBrowserAndroid() : boolean

Determine if the browser is Android or not (last updated 1.7)

Returns

boolean —

True if the browser is Android otherwise false

checkPlatform()

checkPlatform()

Determine the user's platform (last updated 1.7)