PHP code example of thytanium / agent

1. Go to this page and download the library: Download thytanium/agent library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

thytanium / agent example snippets


	'providers' => array(
		...
		'Thytanium\Agent\AgentServiceProvider',
	);
	
	...
	
	'aliases' array(
		...
		'Agent' => 'Thytanium\Agent\Facades\Agent',
	);
	

$browser = Agent::browser() //Firefox, Chrome, etc.

$version = Agent::version() //35.0, 34.0, etc.

$platform = Agent::platform() //Windows 8, Windows XP, Linux, MacOS X

$mobile = Agent::mobile() //iPhone, iPad, PlayStation 3, Android

$robot = Agent::robot() //Googlebot, Bing, Yahoo

$languages = Agent::languages() //en-us, es-ar, en-gb

$charsets = Agent::charsets() //utf-8, iso-8859-1

$browser = Agent::isBrowser() //true or false

$robot = Agent::isRobot() //true or false

$mobile = Agent::isMobile() //true or false

$desktop = Agent::isDesktop() //true or false

$language = Agent::acceptLanguage('en') //true or false

$charset = Agent::acceptCharset('utf-8') //true or false