Mobile-Detect 判断设备

git 地址

https://github.com/serbanghita/Mobile-Detect

git 例子

https://github.com/serbanghita/Mobile-Detect/wiki/Code-examples

一个简单的php判断

$detect = new Mobile_Detect;

if( $detect->isTablet() ){
$source_device = 'mobile';
} else if( $detect->isiOS() ){
$source_device = 'app_ios';
} else if( $detect->isAndroidOS() ){
$source_device = 'app_android';
} else {
$source_device = 'desktop';
}

588 total views, 2 views today

Revisions

There are no revisions for this post.

No comments yet.

发表评论