Mobile false pc True no PC
function Is_mobile () {
$agent = Strtolower ($_server[' http_user_agent ');
$is _pc = (Strpos ($agent, ' Windows NT '))? True:false;
$is _mac = (Strpos ($agent, ' Mac OS ')? True:false;
/* $is _linux = (Strpos ($agent, ' Linux ')? True:false;
$is _unix = (Strpos ($agent, ' Unix '))? True:false;
*/
$is _iphone = (Strpos ($agent, ' iphone ')? True:false;
$is _android = (Strpos ($agent, ' Android ')? True:false;
$is _ipad = (Strpos ($agent, ' ipad ')? True:false;
if ($is _pc) {
return false;
}
if ($is _mac) {
return true;
}
/* if ($is _linux) {
return false;
}
if ($is _unix) {
return false;
} */
if ($is _iphone) {
return true;
}
if ($is _android) {
return true;
}
if ($is _ipad) {
return true;
}
}
function Infoagent () {
$agent = Strtolower ($_server[' http_user_agent ');
return $agent;
}
function Is_iphone () {
$info = false;
if (Strpos (Tecrm::infoagent (), ' iphone ')} {
$info = "iphone";
}
return $info;
}
function Is_android () {
$info = false;
if (Strpos (Tecrm::infoagent (), ' Android ')} {
$info = "Android";
}
return $info;
}
function Is_ipad () {
$info = false;
if (Strpos (Tecrm::infoagent (), ' ipad ')} {
$info = "ipad";
}
return $info;
}
PHP $_server[' http_user_agent '] 2