摘要:方法判斷是否屬手機調用您使用的是移動設備訪問
方法
//判斷是否屬手機 function is_mobile() { $user_agent = $_SERVER["HTTP_USER_AGENT"]; $mobile_agents = Array("240x320","acer","acoon","acs-","abacho","ahong","airness","alcatel","amoi","android","anywhereyougo.com","applewebkit/525","applewebkit/532","asus","audio","au-mic","avantogo","becker","benq","bilbo","bird","blackberry","blazer","bleu","cdm-","compal","coolpad","danger","dbtel","dopod","elaine","eric","etouch","fly ","fly_","fly-","go.web","goodaccess","gradiente","grundig","haier","hedy","hitachi","htc","huawei","hutchison","inno","ipad","ipaq","ipod","jbrowser","kddi","kgt","kwc","lenovo","lg ","lg2","lg3","lg4","lg5","lg7","lg8","lg9","lg-","lge-","lge9","longcos","maemo","mercator","meridian","micromax","midp","mini","mitsu","mmm","mmp","mobi","mot-","moto","nec-","netfront","newgen","nexian","nf-browser","nintendo","nitro","nokia","nook","novarra","obigo","palm","panasonic","pantech","philips","phone","pg-","playstation","pocket","pt-","qc-","qtek","rover","sagem","sama","samu","sanyo","samsung","sch-","scooter","sec-","sendo","sgh-","sharp","siemens","sie-","softbank","sony","spice","sprint","spv","symbian","tablet","talkabout","tcl-","teleca","telit","tianyu","tim-","toshiba","tsm","up.browser","utec","utstar","verykool","virgin","vk-","voda","voxtel","vx","wap","wellco","wig browser","wii","windows ce","wireless","xda","xde","zte"); $is_mobile = false; foreach ($mobile_agents as $device) { if (stristr($user_agent, $device)) { $is_mobile = true; break; } } return $is_mobile; }
調用
if( is_mobile() ){ echo "您使用的是移動設備訪問"; }
文章版權歸作者所有,未經允許請勿轉載,若此文章存在違規行為,您可以聯系管理員刪除。
轉載請注明本文地址:http://specialneedsforspecialkids.com/yun/30368.html
摘要:判斷是否屬手機使用您使用的是移動設備訪問 //判斷是否屬手機 function is_mobile() { $user_agent = $_SERVER[HTTP_USER_AGENT]; $mobile_agents = Array(240x320,acer,acoon,acs-,abacho,ahong,airness,alcatel,amoi,android,an...
摘要:前言協議和加密是前端可能會接觸到的加密所以我就將他們進行了一個歸納原理就是在加入層是安全的基礎協議是在基礎上加了協議使用端口是端口由網景公司開發并內置在瀏覽器中作用建立一個信息安全通道來保證數據傳輸的安全確認網站的真實性可以查看網站認證的真 前言 https,SSH協議和MD5加密是前端可能會接觸到的加密,所以我就將他們進行了一個歸納. 1.https 1.1原理 A.就是在http加...
摘要:前言協議和加密是前端可能會接觸到的加密所以我就將他們進行了一個歸納原理就是在加入層是安全的基礎協議是在基礎上加了協議使用端口是端口由網景公司開發并內置在瀏覽器中作用建立一個信息安全通道來保證數據傳輸的安全確認網站的真實性可以查看網站認證的真 前言 https,SSH協議和MD5加密是前端可能會接觸到的加密,所以我就將他們進行了一個歸納. 1.https 1.1原理 A.就是在http加...
摘要:小練習作者本文首發博客功能基于進行登錄,注冊,留言的簡單網站。所以這個小練習,從一個簡單的方面入手,希望能給踩過同樣多坑的同路人一點啟發。就意味著要重新登錄。的作用是進行進程守護,當你的意外的停止的時候,進行重啟。 Vue+Koa+Mongodb 小練習 作者: Pawn 本文首發: Pawn博客 功能: 基于vue koa mongodb進行登錄,注冊,留言的簡單網站。 體驗地址: ...
閱讀 882·2021-11-23 09:51
閱讀 1089·2021-11-15 17:57
閱讀 1667·2021-09-22 15:24
閱讀 812·2021-09-07 09:59
閱讀 2221·2019-08-29 15:10
閱讀 1849·2019-08-29 12:47
閱讀 751·2019-08-29 12:30
閱讀 3369·2019-08-26 13:51