functionIsMobile () {if(isset($_server[' Http_x_wap_profile '])) {//If you have http_x_wap_profile, it must be a mobile device . return true; } if(isset($_server[' Http_via '])) {//if the VIA message contains a WAP, it must be a mobile device, and some service providers block that information return Stristr($_server[' Http_via '], "WAP")?true:false;//not found for flase, otherwise true } if(isset($_server[' Http_user_agent '])){ $clientkeywords=Array(' Nokia ', '
partition of the SD card to the boot directory in the onboard directory.Touch cplst.txt # create a txt fileNano cplst.txt # edit the content as follows:/Dev /*/Proc /*/Sys /*/Media /*/Mnt /*/Run /*/Tmp /*Press ctrl + x, enter y, and press enter to save.12. Then executeRsync-avc --exclude-from?cplst.txt // mnt # synchronize the TF card system to the NANDAfter the preceding command is executed, enter shutdown-h now to turn off the power, remove the TF card, and restart the system. At this time, t
Festival. Tian xiao is not encouraged by the clock, and Yue Ming is not a night pedestrian. "Text [number ++] = "The Name Of The World's Best guest, I am awake in the middle of the road. He decided to see the sky go up and clear the sky. -Daoshi Chongyang zhenren"Text [number ++] = "no trace is found when it comes to current affairs. Why should we ask more questions? This is just a dream. "Text [number ++] = "is like a dream in the cloud. I don't know what else it is. He is not allowed to share
This article will share with you a function used by php to determine whether to access mobile terminals. it was previously added to the favorites list. it is released here and recommended to our friends. I forgot where I got the function. I just couldn't find it in a package and saved it temporarily.
The code is as follows:
/*** Mobile access?** @ Return bool*/Function isMobile (){// If HTTP_X_WAP_PROFILE exists, it must be a mobile device.If (isset ($ _ SERVER ['http _ X_WAP_PROFILE ']){Retur
, medical instruments, aerospace, set-top boxes, mobile phones, and PDAs. a Data Management Technology designed. Since its publication, eXtremeDB real-time databases have been welcomed by the industry, in the Longbow radar system of Boeing's Apache helicopter, F5 network company router, China East China Power Grid and Huadian Group's power system, North China Electric Power University, Electric Power Research Institute, the creation of weiye Company call Center, Genesis Microchip/Philipps/Direct
]
For details, see section 2]
Configure/Application/Mobile/Controller/CommonController. class. php [public class]
[See section 3] ThinkPHP
-->
$velocityCount-->
-->
Function isMobile () {// if HTTP_X_WAP_PROFILE exists, it must be a mobile device if (isset ($ _ SERVER ['HTTP _ X_WAP_PROFILE ']) return true; // This is taken from TPM intelligent switch template engine. It is suitable for TPM to develop if (isset ($ _ SERVER ['HTTP _ client']). 'phoneclient' ==$ _ SERVER ['HTTP _ client']) re
different clients.The disadvantage of this method is that the mobile terminal and PC end use the same domain name, and there is a black hat suspect, and UA is not always accurate, if the judgment is wrong, you cannot manually modify the website type.The key Nginx configuration is as follows:
Location/{# default PC-side access content root/usr/local/website/web; # if it is mobile-side access content if ($ http_user_agent ~ "(MIDP) | (WAP) | (UP. browser) | (Smartphone) | (Obigo) | (Mobile) | (AU
is an example of php. after reading it, you will know how unreliable it is.
1. function is_wap (){
2. $ ua = strtolower ($ _ SERVER ['http _ USER_AGENT ']);
3. $ uachar = "/(nokia | sony | ericsson | mot | samsung | sgh | lg | sie | philips | panasonic | alcatel | lenovo | cldc | midp | wap | mobile) /I ";
4. if ($ ua = ''| preg_match ($ uachar, $ ua ))! Strpos (strtolower ($ _ SERVER ['request _ URI ']), 'wap ')){
5. return true;
6.} else {
7. retu
. Determine whether it is mobile or PC-side
* * To determine if the current user is the PC or the phone end returns true for the phone side false for the PC side * @return Boolean *//** * Whether the Mobile Access access * * @return bool */function IsMobile () {///If there is http_x_wap_profile, it must be the mobile device if (Isset ($_server[' http_x_wap_profile ')) return true; If the VIA information contains WAP, it must be a mobile device, some service associations block the information
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.