Jenssegers\Agent\Agent::isPhone PHP Method

isPhone() public method

Check if the device is a mobile phone.
public isPhone ( string $userAgent = null, array $httpHeaders = null ) : boolean
$userAgent string deprecated
$httpHeaders array deprecated
return boolean
    public function isPhone($userAgent = null, $httpHeaders = null)
    {
        return $this->isMobile() && !$this->isTablet();
    }

Usage Example

Ejemplo n.º 1
0
 public function getPlatform()
 {
     if ($this->agent->isPhone()) {
         return 'phone';
     }
     if ($this->agent->isTablet()) {
         return 'tablet';
     }
     if ($this->agent->isMobile()) {
         return 'mobile';
     }
     if ($this->agent->isDesktop()) {
         return 'desktop';
     }
     if ($this->agent->isRobot()) {
         return 'robot';
     }
     return null;
 }
All Usage Examples Of Jenssegers\Agent\Agent::isPhone