An open source PHP program based on the MIT License:
http://code.google.com/p/php-mobile-detect/
The program is just a file, you can just quote it directly after downloading.
How to use:
-
- //Detect whether a mobile phone is accessing the website
- include("Mobile_Detect.php");
- $detect = new Mobile_Detect();
-
- if ($detect->isMobile()) {
- // any mobile platform
- echo 'isMobile';
- }
- else{
- echo 'isPC';
- } // bbs.it-home.org
- ?>
Copy code
|