How can I determine whether a web page is viewed on a pc or a mobile phone? How can I determine whether a web page is viewed on a pc or a mobile phone?
Reply content:
How can I determine whether a web page is viewed on a pc or a mobile phone?
PHPA library for mobile phone detection is very famous.Mobile-DetectAddress: https://packagist.org/packages/mobiledetect/mobiledetectlib
0?$matches[0]:''; function CheckSubstrs($substrs,$text){ foreach($substrs as $substr){ i
How to determine whether to use PC-side or mobile-browsing Web page?
Reply content:
How to determine whether to use PC-side or mobile-browsing Web page?
PHPThere's a library of cell phone tests.Mobile-DetectAddress: Https://packagist.org/packages/mobiledetect/mobiledetectlib
0. $matches [0]: "; function Checksubstrs ($substrs, $text) {foreach ($substrs as $substr) {if (False!==strpos ($text, $substr)) { return true; }else{return false; }}} $mobile
: This article describes how to use php to determine whether the client is a mobile device. For more information about PHP tutorials, see.
// Determine whether the mobile phone function is_mobile () {$ user_agent = $ _ SERVER ['http _ USER_AGENT ']; $ mobile_agents = Array ("240x320", "acer ", "ACO on", "acs-", "abacho", "ahong", "airness", "alcatel", "amoi", "android", "anywhereyougo.com ", "applewebkit/525", "applewebkit/532", "asus", "audio", "au-mic", "avantogo", "becker", "benq ", "bilbo",
detector on the Compaq iPAQ handheld device (which has a powerful arm processor with low power dissipation of MIPS, this processor lacks floating point arithmetic) and achieved two frames per second.The remainder of this article describes our contributions and some of the experimental results, including a detailed description of our experimental methods. Closely related work at the end of each section of the place.2. FeaturesOur goal detection progra
This code can detect if the user is using a mobile device to browse the Web, and the test is complete.
$mobile _browser = ' 0 ';
if (Preg_match ('/(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone)/I ',
Strtolower ($_server[' http_user_agent '))) {
$mobile _browser++;
}
if ((Strpos (Strtolower ($_server[' http_accept '), ' application/vnd.wap.xhtml+xml ') >0) or
((Isset ($_server[' http_x_wap_profile ') or isset ($_serve
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.