php - 如何在 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。
谢谢。
解决方案
推荐阅读
- node.js - 当我通过 962122961v 时 findOneAndRemove 删除了错误的用户,它将删除 962122963v
- c++ - 如何存储用户输入到 for 循环中的值?
- google-drive-api - 提交同意屏幕进行验证是否会自动触发未经验证的应用屏幕?
- python - 关于 MTCNN 中的人脸检测,在 align_dataset_mtcnn.py 中。这是什么意思?
- php - 如何将 ReCAPTCHA 集成到 WORDPRESS 中的默认登录表单/评论中
- html - css位置绝对菜单顶部
- android - 如何在 Ionic 中跨页面传递数据?
- reactjs - 我正在尝试使用弹出版本的 create-react-app 设置 React 故事书
- c# - 数组乘对
- ansible - Ansible-在剧本中执行最后一个强制角色,即使执行流程中的任何先前角色都失败了