to do this, you can use PHP to determine the device type and then display the corresponding interface and content. Today, I am sharing a PHP method to determine whether a device is a mobile phone or tablet. the method is derived from WordPress (wp-des/vars. php: 125) and is applicable to most types of
The user agent Chinese name is the users proxy, is part of the HTTP protocol, is part of the header domain, the user agent is also referred to as UA. It is a special string header that provides access to the Web site with information such as the type and version of the brows
Online now there are three views, one is based on the browser sent User-agent, but obviously this method is not feasible, although some people list the most mobile phone sent user-agent, but there will still be a lot of mobile phones are not recognized, and even some mobile
Original link: http://caibaojian.com/browser-ios-or-android.htmlVia can open your android phone or iphone scan to see the original from: http://caibaojian.com/browser-ios-or-android.html The following is a more comprehensive browser check function, provide more check content, you can check whether it is mobile, ipad,
1, the first type:
Copy Code code as follows:
function ispc () {
var useragentinfo = navigator.useragent;
var Agents = ["Android", "IPhone",
"SymbianOS", "Windows Phone",
"IPad", "IPod"];
var flag = true;
for (var v = 0; v if (Useragentinfo.indexof (Agents[v]) > 0) {
Flag = false;
Break
}
}
return flag;
}
2. The second type:
Copy Code code as follows:
function Browserredirect () {
var suseragent =
Php judges whether mobile browsing is web browsing, and executes the corresponding action, phpweb
Yes. I have been searching for it online for a long time. record it.
1 function isMobile () {2 $ useragent = isset ($ _ SERVER ['HTTP _ USER_AGENT '])? $ _ SERVER ['HTTP _ USER_AGENT ']: ''; 3 $ useragent_commentsblock = preg_match (' | \(.*? \) | ', $ Useragent, $ matches)> 0? $ Matches [0]: ''; 4 function Che
Header (' content-type:text/html; Charset=utf-8 ');//define page encoding as UTF8$is _pc = (Strpos ($agent, ' Windows NT '))? Whether the true:false;//is a PC PC-side$is _mobi = (Strpos ($agent, ' Mobile '))? Whether the true:false;//is a
To determine the status of a mobile phone screen:
function hengshuping () {
if (window.orientation==180| | window.orientation==0) {
alert ("Vertical screen state!") ")
}
if (window.orientation==90| | WINDOW.ORIENTATION==-90) {
alert ("Horizontal screen state!") ")
}
}
window.addeventlistener (" Onorientationchange "in Window?) Orientationchange ":" Resize ", hengshuping, false);
Mobile end of the brows
In some cases, we need to determine whether the HTTP request is from the phone or the computer side, the key is to obtain user-agent information, screening and judgment can be.The core classes are as follows:public static Boolean IsMobileDevice (String requestheader) { /** * android: All Android devices * Mac OS: iphone ipad * Wind
Skype should be a veteran of online video phones, but unfortunately it is not booming on popular handheld devices. Our main use cases are just traditional PCs. Although Skype has a certain relationship with T-Mobile, we can use its beta version on T-Mobile's Android system, but for other mobile users, it basically belongs to PC software.
The FaceTime of
Google icon design is more consistent than Apple iPhone icons
BKJIA Internet headlines in June 19, 2013] Apple's new iPhone operating system was regarded as an unsuccessful upgrade product one week after it was launched, today, let's take a closer look at the rigorous guidance that Google's design team follows. It tells us why all Google's app icons look similar
7. What do you think?The game has taken shape. Just make yourself a cup of coffee. Well, forget it. Caffeine is not good for the next generation.After reading all the above, what do you think? Do not say no. You must be as excited as I do with the excitement and numerous questions of completing clone. The question about gameplay, game engines, and so on comes one after another. You may even wonder if there
documents in browsers
This PDF Viewer extension allows users to easily read pdf documents in Mobile browsers, saving users from tedious steps such as downloading and opening. In addition, saving as pdf is also a highlight of Firefox for Android. Users can directly Save the current webpage as PDF and save the layout of the current webpage to the maximum extent. Without WIFI, you can continue reading the pre
This period of time is to do PC-side business, the result manager found me, may want to do mobile applications, background logic or I write the logic, but need to change some, to see how to deal with.Because the mobile and PC side is slightly different, I think it is best to
(); selection.addRange(range); /*if(selection.setBaseAndExtent){ selection.setBaseAndExtent(text, 0, text, 1); }*/ }else{ alert("none"); }}
Unfortunately, on iphone Safari, you still cannot click or press it to highlight all text (since Windows is also supported. getSelection: Why the Safari text cannot be selected. If you know the reason, please leave a message ). Therefore,
Recently mobile Internet hot we need to do a PC station with WAP station, to achieve if the user is a computer to access the WAP station automatically into the PC station, and vice versa, below I have compiled some code with you to see.
Method One: Judge Http_user_agent
The code is as follows
Copy Code
$agent = Strtolower ($_server[' h
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.