有一個基於MIT License協議開源的PHP程序
http://code.google.com/p/php-mobile-detect/
程序就是一個文件,下載之後直接引用就可以。
使用方法:
<?php
include("Mobile_Detect.php");
$detect = new Mobile_Detect();
if ($detect->isMobile()) {
// any mobile platform
echo 'isMobile';
}
else{
echo 'isPC';
}
?>