當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WURFL_Handlers_Utils::checkIfContainsAnyOf方法代碼示例

本文整理匯總了PHP中WURFL_Handlers_Utils::checkIfContainsAnyOf方法的典型用法代碼示例。如果您正苦於以下問題:PHP WURFL_Handlers_Utils::checkIfContainsAnyOf方法的具體用法?PHP WURFL_Handlers_Utils::checkIfContainsAnyOf怎麽用?PHP WURFL_Handlers_Utils::checkIfContainsAnyOf使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WURFL_Handlers_Utils的用法示例。


在下文中一共展示了WURFL_Handlers_Utils::checkIfContainsAnyOf方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: canHandle

 public function canHandle($userAgent)
 {
     if (WURFL_Handlers_Utils::isDesktopBrowser($userAgent)) {
         return false;
     }
     return WURFL_Handlers_Utils::checkIfStartsWith($userAgent, 'Mozilla/5') && WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('iPhone', 'iPod', 'iPad'));
 }
開發者ID:vazahat,項目名稱:dudex,代碼行數:7,代碼來源:AppleHandler.php

示例2: canHandle

 public function canHandle($userAgent)
 {
     if (WURFL_Handlers_Utils::isDesktopBrowser($userAgent)) {
         return false;
     }
     return WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('iPhone', 'iPod', 'iPad')) && !WURFL_Handlers_Utils::checkIfContains($userAgent, 'Symbian');
 }
開發者ID:acasademont,項目名稱:wurfl,代碼行數:7,代碼來源:AppleHandler.php

示例3: canHandle

 public function canHandle($userAgent)
 {
     if (WURFL_Handlers_Utils::isDesktopBrowser($userAgent)) {
         return false;
     }
     return WURFL_Handlers_Utils::checkIfContains($userAgent, 'Android') && WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('Opera Mobi', 'Opera Tablet'));
 }
開發者ID:vazahat,項目名稱:dudex,代碼行數:7,代碼來源:OperaMobiOrTabletOnAndroidHandler.php

示例4: normalize

 public function normalize($userAgent)
 {
     // Normalize Android version
     $userAgent = preg_replace('/(Android)[ \\-\\/](\\d\\.\\d)([^; \\/\\)]+)/', '$1 $2', $userAgent);
     // Opera Mobi/Tablet
     $is_opera_mobi = WURFL_Handlers_Utils::checkIfContains($userAgent, 'Opera Mobi');
     $is_opera_tablet = WURFL_Handlers_Utils::checkIfContains($userAgent, 'Opera Tablet');
     if ($is_opera_mobi || $is_opera_tablet) {
         $opera_version = WURFL_Handlers_AndroidHandler::getOperaOnAndroidVersion($userAgent, false);
         $android_version = WURFL_Handlers_AndroidHandler::getAndroidVersion($userAgent, false);
         if ($opera_version !== null && $android_version !== null) {
             $opera_model = $is_opera_tablet ? 'Opera Tablet' : 'Opera Mobi';
             $prefix = $opera_model . ' ' . $opera_version . ' Android ' . $android_version . WURFL_Constants::RIS_DELIMITER;
             return $prefix . $userAgent;
         }
     }
     // Stock Android
     if (!WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, $this->skip_normalization)) {
         $model = WURFL_Handlers_AndroidHandler::getAndroidModel($userAgent, false);
         $version = WURFL_Handlers_AndroidHandler::getAndroidVersion($userAgent, false);
         if ($model !== null && $version !== null) {
             $prefix = $version . ' ' . $model . WURFL_Constants::RIS_DELIMITER;
             return $prefix . $userAgent;
         }
     }
     return $userAgent;
 }
開發者ID:NinjoCat,項目名稱:Ninjo,代碼行數:27,代碼來源:Android.php

示例5: applyRecoveryMatch

 public function applyRecoveryMatch($userAgent)
 {
     if (WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('SLCC1', 'Media Center PC', '.NET CLR', 'OfficeLiveConnector'))) {
         return WURFL_Constants::GENERIC_WEB_BROWSER;
     }
     return WURFL_Constants::NO_MATCH;
 }
開發者ID:vazahat,項目名稱:dudex,代碼行數:7,代碼來源:MSIEHandler.php

示例6: applyRecoveryMatch

 public function applyRecoveryMatch($userAgent)
 {
     if (WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('Macintosh', 'Windows'))) {
         return WURFL_Constants::GENERIC_WEB_BROWSER;
     }
     return WURFL_Constants::NO_MATCH;
 }
開發者ID:dcunited08,項目名稱:wurfl-api,代碼行數:7,代碼來源:SafariHandler.php

示例7: canHandle

 public function canHandle($userAgent)
 {
     if (WURFL_Handlers_Utils::isDesktopBrowser($userAgent)) {
         return false;
     }
     return WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array("LGUPLUS", "lgtelecom"));
 }
開發者ID:vazahat,項目名稱:dudex,代碼行數:7,代碼來源:LGUPLUSHandler.php

示例8: canHandle

 public function canHandle($userAgent)
 {
     if (WURFL_Handlers_Utils::checkIfContainsAll($userAgent, array('Android', '/Kindle'))) {
         return false;
     }
     return WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('Kindle', 'Silk'));
 }
開發者ID:dcunited08,項目名稱:wurfl-api,代碼行數:7,代碼來源:KindleHandler.php

示例9: canHandle

 public function canHandle($userAgent)
 {
     if (WURFL_Handlers_Utils::isDesktopBrowser($userAgent)) {
         return false;
     }
     return WURFL_Handlers_Utils::checkIfContains($userAgent, 'Nokia') && !WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('Android', 'iPhone'));
 }
開發者ID:acasademont,項目名稱:wurfl,代碼行數:7,代碼來源:NokiaHandler.php

示例10: canHandle

 public function canHandle($userAgent)
 {
     if (WURFL_Handlers_Utils::isDesktopBrowser($userAgent)) {
         return false;
     }
     return WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('Samsung', 'SAMSUNG')) || WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array('SEC-', 'SPH', 'SGH', 'SCH'));
 }
開發者ID:dcunited08,項目名稱:wurfl-api,代碼行數:7,代碼來源:SamsungHandler.php

示例11: canHandle

 public function canHandle($userAgent)
 {
     if (WURFL_Handlers_Utils::isMobileBrowser($userAgent)) {
         return false;
     }
     return WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('Thunderbird', 'Microsoft Outlook', 'MSOffice'));
 }
開發者ID:acasademont,項目名稱:wurfl,代碼行數:7,代碼來源:DesktopApplicationHandler.php

示例12: canHandle

 public function canHandle($userAgent)
 {
     if (WURFL_Handlers_Utils::isDesktopBrowser($userAgent)) {
         return false;
     }
     return WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('Windows Phone', 'WindowsPhone', 'NativeHost'));
 }
開發者ID:conversionstudio,項目名稱:cpatracker,代碼行數:7,代碼來源:WindowsPhoneHandler.php

示例13: normalize

 public function normalize($userAgent)
 {
     if (WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('WPDesktop', 'ZuneWP7')) || WURFL_Handlers_Utils::checkIfContainsAll($userAgent, array('Mozilla/5.0 (Windows NT ', ' ARM;', ' Edge/'))) {
         $model = WURFL_Handlers_WindowsPhoneHandler::getWindowsPhoneDesktopModel($userAgent);
         $version = WURFL_Handlers_WindowsPhoneHandler::getWindowsPhoneDesktopVersion($userAgent);
     } else {
         if (WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array('Windows Phone Ad Client', 'WindowsPhoneAdClient'))) {
             $model = WURFL_Handlers_WindowsPhoneHandler::getWindowsPhoneAdClientModel($userAgent);
             $version = WURFL_Handlers_WindowsPhoneHandler::getWindowsPhoneVersion($userAgent);
         } else {
             if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'NativeHost')) {
                 return $userAgent;
             } else {
                 $model = WURFL_Handlers_WindowsPhoneHandler::getWindowsPhoneModel($userAgent);
                 $version = WURFL_Handlers_WindowsPhoneHandler::getWindowsPhoneVersion($userAgent);
             }
         }
     }
     if ($model !== null && $version !== null) {
         // "WP" is for Windows Phone
         $prefix = 'WP' . $version . ' ' . $model . WURFL_Constants::RIS_DELIMITER;
         return $prefix . $userAgent;
     }
     return $userAgent;
 }
開發者ID:dcunited08,項目名稱:wurfl-api,代碼行數:25,代碼來源:WindowsPhone.php

示例14: applyRecoveryMatch

 public function applyRecoveryMatch($userAgent)
 {
     if (WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('MIB/2.2', 'MIB/BER2.2'))) {
         return "mot_mib22_generic";
     }
     return null;
 }
開發者ID:godboko,項目名稱:modules,代碼行數:7,代碼來源:MotorolaHandler.php

示例15: canHandle

 public function canHandle($userAgent)
 {
     if (WURFL_Handlers_Utils::isMobileBrowser($userAgent)) {
         return false;
     }
     return WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('Opera', 'OPR/'));
 }
開發者ID:acasademont,項目名稱:wurfl,代碼行數:7,代碼來源:OperaHandler.php


注:本文中的WURFL_Handlers_Utils::checkIfContainsAnyOf方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。