本文整理匯總了PHP中Mobile_Detect::isSony方法的典型用法代碼示例。如果您正苦於以下問題:PHP Mobile_Detect::isSony方法的具體用法?PHP Mobile_Detect::isSony怎麽用?PHP Mobile_Detect::isSony使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Mobile_Detect
的用法示例。
在下文中一共展示了Mobile_Detect::isSony方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: get_device_name
function get_device_name($userAgent)
{
$detect = new Mobile_Detect();
$detect->setUserAgent($userAgent);
$deviceType = $detect->isMobile() ? $detect->isTablet() ? 'tablet' : 'cell' : 'computer';
if ($deviceType == 'computer') {
return $deviceType;
}
$name = 'unknow';
do {
if ($detect->isiPhone()) {
$name = 'iPhone';
break;
}
if ($detect->isBlackBerry()) {
$name = 'BlackBerry';
break;
}
if ($detect->isHTC()) {
$name = 'HTC';
break;
}
if ($detect->isNexus()) {
$name = 'Nexus';
break;
}
if ($detect->isDell()) {
$name = 'Dell';
break;
}
if ($detect->isMotorola()) {
$name = 'Motorola';
break;
}
if ($detect->isSamsung()) {
$name = 'Samsung';
break;
}
if ($detect->isLG()) {
$name = 'LG';
break;
}
if ($detect->isSony()) {
$name = 'Sony';
break;
}
if ($detect->isAsus()) {
$name = 'Asus';
break;
}
if ($detect->isPalm()) {
$name = 'Palm';
break;
}
if ($detect->isVertu()) {
$name = 'Vertu';
break;
}
if ($detect->isPantech()) {
$name = 'Pantech';
break;
}
if ($detect->isFly()) {
$name = 'Fly';
break;
}
if ($detect->isSimValley()) {
$name = 'SimValley';
break;
}
if ($detect->isGenericPhone()) {
$name = 'Generic';
break;
}
if ($detect->isiPad()) {
$name = 'iPad';
break;
}
if ($detect->isNexusTablet()) {
$name = 'Nexus';
break;
}
if ($detect->isSamsungTablet()) {
$name = 'Samsung';
break;
}
if ($detect->isKindle()) {
$name = 'Kindle';
break;
}
if ($detect->isSurfaceTablet()) {
$name = 'Surface';
break;
}
if ($detect->isAsusTablet()) {
$name = 'Asus';
break;
}
if ($detect->isBlackBerryTablet()) {
$name = 'BlackBerry';
//.........這裏部分代碼省略.........