Documentation

Browser
in package

Internally uses the PhpUserAgent package https://github.com/donatj/PhpUserAgent

Table of Contents

Properties

$useragent  : array<string|int, string>

Methods

__construct()  : mixed
Browser constructor.
getBrowser()  : string
Get the current browser identifier
getLongVersion()  : string
Get the current full version identifier
getPlatform()  : string
Get the current platform identifier
getVersion()  : int
Get the current major version identifier
isHuman()  : bool
Determine if the request comes from a human, or from a bot/crawler
isTrackable()  : bool
Determine if “Do Not Track” is set by browser

Properties

$useragent

protected array<string|int, string> $useragent = []

Methods

__construct()

Browser constructor.

public __construct() : mixed

getBrowser()

Get the current browser identifier

public getBrowser() : string

Currently detected browsers:

Android Browser BlackBerry Browser Camino Kindle / Silk Firefox / Iceweasel Safari Internet Explorer IEMobile Chrome Opera Midori Vivaldi TizenBrowser Lynx Wget Curl

Return values
string

the lowercase browser name

getLongVersion()

Get the current full version identifier

public getLongVersion() : string
Return values
string

the browser full version identifier

getPlatform()

Get the current platform identifier

public getPlatform() : string

Currently detected platforms:

Desktop -> Windows -> Linux -> Macintosh -> Chrome OS Mobile -> Android -> iPhone -> iPad / iPod Touch -> Windows Phone OS -> Kindle -> Kindle Fire -> BlackBerry -> Playbook -> Tizen Console -> Nintendo 3DS -> New Nintendo 3DS -> Nintendo Wii -> Nintendo WiiU -> PlayStation 3 -> PlayStation 4 -> PlayStation Vita -> Xbox 360 -> Xbox One

Return values
string

the lowercase platform name

getVersion()

Get the current major version identifier

public getVersion() : int
Return values
int

the browser major version identifier

isHuman()

Determine if the request comes from a human, or from a bot/crawler

public isHuman() : bool
Return values
bool

        
On this page

Search results