$ua
=
$_SERVER
[
'HTTP_USER_AGENT'
];
if
(preg_match(
"/^DoCoMo\/2\.0/i"
,
$ua
)) {
$isMobile
= true;
}
else
if
(preg_match(
"/^DoCoMo\/1\.0/i"
,
$ua
)) {
$isMobile
= true;
}
else
if
(preg_match(
"/^SoftBank/i"
,
$ua
)) {
$isMobile
= true;
}
else
if
(preg_match(
"/^(Vodafone|MOT-)/i"
,
$ua
)) {
$isMobile
= true;
}
else
if
(preg_match(
"/^J\-PHONE/i"
,
$ua
)) {
$isMobile
= true;
}
else
if
(preg_match(
"/iPhone/i"
,
$ua
)) {
$isMobile
= true;
}
else
if
(preg_match(
"/^KDDI\-/i"
,
$ua
)) {
$isMobile
= true;
}
else
if
(preg_match(
"/UP\.Browser/i"
,
$ua
)) {
$isMobile
= true;
}
else
if
(preg_match(
"/WILLCOM/i"
,
$ua
) ||
preg_match(
"/DDIPOCKET/i"
,
$ua
)){
$isMobile
= true;
}
else
if
(preg_match(
"/^PDXGW/i"
,
$ua
)) {
$isMobile
= true;
}
else
if
(preg_match(
"/^(L\-mode)/i"
,
$ua
)) {
$isMobile
= true;
}
else
{
$isMobile
= false;
}
No comments:
Post a Comment