Visitor::ua PHP Method

ua() public static method

Returns the user agent string of the current visitor
public static ua ( ) : string
return string
    public static function ua()
    {
        return isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : null;
    }

Usage Example

Esempio n. 1
0
 /**
  * Generates a fingerprint from the user agent string
  * 
  * @return string
  */
 public static function fingerprint()
 {
     if (!r::cli()) {
         return sha1(Visitor::ua() . (ip2long($_SERVER['REMOTE_ADDR']) & ip2long('255.255.0.0')));
     } else {
         return '';
     }
 }