檢測手機設備種類的 PHP 類 - php-mobile-detect

openkk 13年前發布 | 27K 次閱讀 PHP PHP開發

php-mobile-detect 是一個 PHP 類,用來通過 User-Agent 檢測各種手機設備。

示例代碼:

include("Mobile_Detect.php");
$detect = new Mobile_Detect();
if($detect->iOS()){
    // code to run for the Apple iOS platform.
}
if($detect->isAndroidOS()){
    // code to run for the Google Android platform.
}
if ($detect->isMobile()) {
    // any mobile platform
}
if($detect->isTablet()){
    // any tablet
}

項目主頁:http://www.baiduhome.net/lib/view/home/1337065481525

 本文由用戶 openkk 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!