serbanghita / Mobile-Detect

Mobile_Detect is a lightweight PHP class for detecting mobile devices (including tablets). It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.
http://mobiledetect.net
MIT License
10.52k stars 2.67k forks source link

How to get only mobile name? #874

Closed PCcloob closed 1 year ago

PCcloob commented 2 years ago

How can i get only mobile name?

Result like : your System is "Android" and Model is "Redmi 9s".

I try this :

require_once 'Mobile_Detect.php';
$user_agent=$_SERVER['HTTP_USER_AGENT']; 
$detect = new Mobile_Detect;
if($detect->isMobile()){
your System is "Android" and Model is $detect->devicename.
}

but Not work!

I use Mobile-Detect 2.8.37 and PHP7.3. Thanks.

serbanghita commented 1 year ago

@PCcloob Mobile Detect as a library has never had that goal.