Back to Browser class

Method isRobot

public bool
isRobot
()
Determines if the browser is a robot or not.
Returns
  • bool True if browser is a known robot.
Since
  • 1.7.0
Class: Browser
Project: Joomla

Method isRobot - Source code

/**
 * Determines if the browser is a robot or not.
 *
 * @return  boolean  True if browser is a known robot.
 *
 * @since   1.7.0
 */
public function isRobot()
{
    foreach ($this->robots as $robot) {
        if (preg_match('/' . $robot . '/', $this->agent)) {
            return true;
        }
    }
    return false;
}