BrowscapPHP\Helper\Support::getUserAgent PHP Méthode

getUserAgent() public méthode

detect the useragent
public getUserAgent ( ) : string
Résultat string
    public function getUserAgent()
    {
        $userAgent = '';
        foreach ($this->userAgentHeaders as $header) {
            if (array_key_exists($header, $this->source) && $this->source[$header]) {
                $userAgent = $this->cleanParam($this->source[$header]);
                break;
            }
        }
        return $userAgent;
    }

Usage Example

 /**
  *
  */
 public function testGetUserAgentWithoutSource()
 {
     $object = new Support();
     self::assertSame('', $object->getUserAgent());
 }
All Usage Examples Of BrowscapPHP\Helper\Support::getUserAgent