JS Method:
var urlqr = location.href;
URLQR = Urlqr.replace (/iphonef_/, "PC") here write the regular replace page address
if (IsPC ()) window.location.replace (URLQR);//pc-side access jumps to the PC page
else Window.location.replace (URLQR);//Otherwise jump to move the page
Determine if PC-side access
function IsPC () {
var useragentinfo = navigator.useragent;
var Agents = ["Android", "IPhone",
"SymbianOS", "Windows Phone",
"IPad", "IPod");
var flag = true;
for (var v = 0; v < agents.length; v++) {
if (Useragentinfo.indexof (Agents[v]) > 0) {
Flag = false;
Break
}
}
return flag;
}
PHP: Determine Web-side access or mobile Access
Just match $_server[' http_user_agent ') variable
if (Stripos ($_server[' http_user_agent '), ' windows ') {
$isWeb = ";
} else {
$isiPhone = ";
}
PC-side and phone-access calls to different pages, JS and PHP different methods