首页 > 解决方案 > 如何在 Mobile-Detect 中仅获取手机名称?

问题描述

我怎样才能只获得手机名称?

结果如下:您的系统是“Android”,型号是“Redmi 9s”。

我试试这个:

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.
}

但不工作!

我使用 Mobile-Detect 2.8.37 和 PHP7.3。

谢谢。

标签: phpmobile

解决方案


推荐阅读