Parse Bots
Function: parseBots
Visibility: public static
Parameter: parseBots($userAgent)
Description:
Robots are crawling all over the internet, we can detect them with this simple function and then we can distinguish them from the real users (notice: not all bots can be detected). It search for bot strings out of user agent data, based on predefined data entered on: botNames.
Parameters:
(required) - string - userAgent - The user agent string.
Return:
array|false - The bot name found. If not will return false.
Callable from (extended classes):
application: controller,view
advanced: controller,view
operators: controller,view
api: controller,view
example: 1
We want to get name of the bot (if any) from the user agent string.
How to call (example):
Possible outcome (example):
Output: