PHP code example of marknotton / agent

1. Go to this page and download the library: Download marknotton/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/ */

    

marknotton / agent example snippets


return [
'userAgentWhitelist' => [
	'APIs-Google',
	'Mediapartners-Google',
	'AdsBot-Google',
	'Googlebot-Image',
	'Googlebot',
	'FeedFetcher-Google'
	]
];

Agent::registerAgentJsFile(<useCompressedFile:bool>, <position:string>);
twig 
{{ craft.agent.version('text') }} // 104.3.0.1 
{{ craft.agent.version('float') }} // 104.3