Documentation
Class libraries
client
client library - collecting information of the OS, browser, mobile device and other from client (visitor).
File framework/config/platforms.ini required as reference.
Library methods
string browser()
Returns client's browser name.
string browser_version()
Returns client's browser version.
array charsets()
Returns accepted Character Sets
array client_arr()
Returns array of defined client information
For example:
Array (
[platform] => Windows 7
[is_browser] => 1
[browser] => Chrome
[browser_version] => 44.0.2403.155
[is_mobile] =>
[mobile] =>
[is_robot] =>
[robot] =>
[charsets] => Array ( )
[languages] => Array (
[0] => en-us
[1] => en
)
[user_agent] => Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.155 Safari/537.36 )
string client_str()
Returns string of defined client information
bool is_accept_charset([string $charset = 'utf-8'])
Check is Accept character set
bool is_accept_language([string $lng = 'en'])
Check is Accept language exists
bool is_browser()
Check if client visited by browser.
bool is_mobile()
Check if client visited by mobile device.
bool is_robot()
Check if client is robot.
array languages()
Returns client's accepted languages.
string mobile()
Returns client's mobile name if visited by mobile.
Empty string will be returned if not a mobile.
string platform()
Returns client's platform.
string robot()
Returns robot's name if visited as robot. Otherwise, empty string will be returned.
string user_agent()
Returns the whole string of client info.
Example:
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.155 Safari/537.36