1. Go to this page and download the library: Download bleuren/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/ */
// Check if the current user agent is a robot.
$isRobot = Agent::isRobot();
// Alternatively, the same result can be achieved with isCrawler()
$isCrawler = Agent::isCrawler();
// You can also check for a specific crawler by passing a user agent string.
$isSpecificCrawler = Agent::isCrawler('specific-user-agent-string');
// Retrieve the name of the detected robot/crawler, if any.
$robot = Agent::robot();