本文整理汇总了PHP中WURFL_Handlers_Utils::checkIfStartsWithOneOf方法的典型用法代码示例。如果您正苦于以下问题:PHP WURFL_Handlers_Utils::checkIfStartsWithOneOf方法的具体用法?PHP WURFL_Handlers_Utils::checkIfStartsWithOneOf怎么用?PHP WURFL_Handlers_Utils::checkIfStartsWithOneOf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WURFL_Handlers_Utils
的用法示例。
在下文中一共展示了WURFL_Handlers_Utils::checkIfStartsWithOneOf方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: applyRecoveryCatchAllMatch
function applyRecoveryCatchAllMatch($userAgent)
{
//Openwave
if (WURFL_Handlers_Utils::checkIfContains($userAgent, "UP.Browser/7.2")) {
return "opwv_v72_generic";
}
if (WURFL_Handlers_Utils::checkIfContains($userAgent, "UP.Browser/7")) {
return "opwv_v7_generic";
}
if (WURFL_Handlers_Utils::checkIfContains($userAgent, "UP.Browser/6.2")) {
return "opwv_v62_generic";
}
if (WURFL_Handlers_Utils::checkIfContains($userAgent, "UP.Browser/6.1")) {
return "opwv_v6_generic";
}
if (WURFL_Handlers_Utils::checkIfContains($userAgent, "UP.Browser/6")) {
return "opwv_v6_generic";
}
if (WURFL_Handlers_Utils::checkIfContains($userAgent, "UP.Browser/5")) {
return "upgui_generic";
}
if (WURFL_Handlers_Utils::checkIfContains($userAgent, "UP.Browser/4")) {
return "uptext_generic";
}
if (WURFL_Handlers_Utils::checkIfContains($userAgent, "UP.Browser/3")) {
return "uptext_generic";
}
//Series 60
if (WURFL_Handlers_Utils::checkIfContains($userAgent, "Series60")) {
return "nokia_generic_series60";
}
// Access/Net Front
if (WURFL_Handlers_Utils::checkIfContains($userAgent, "NetFront/3.0") || WURFL_Handlers_Utils::checkIfContains($userAgent, "ACS-NF/3.0")) {
return "netfront_ver3";
}
if (WURFL_Handlers_Utils::checkIfContains($userAgent, "NetFront/3.1") || WURFL_Handlers_Utils::checkIfContains($userAgent, "ACS-NF/3.1")) {
return "netfront_ver3_1";
}
if (WURFL_Handlers_Utils::checkIfContains($userAgent, "NetFront/3.2") || WURFL_Handlers_Utils::checkIfContains($userAgent, "ACS-NF/3.2")) {
return "netfront_ver3_2";
}
if (WURFL_Handlers_Utils::checkIfContains($userAgent, "NetFront/3.3") || WURFL_Handlers_Utils::checkIfContains($userAgent, "ACS-NF/3.3")) {
return "netfront_ver3_3";
}
if (WURFL_Handlers_Utils::checkIfContains($userAgent, "NetFront/3.4")) {
return "netfront_ver3_4";
}
if (WURFL_Handlers_Utils::checkIfContains($userAgent, "NetFront/3.5")) {
return "netfront_ver3_5";
}
//Windows CE
if (WURFL_Handlers_Utils::checkIfContains($userAgent, "Windows CE")) {
return "ms_mobile_browser_ver1";
}
/**
* Teleca-Obigo Browser
*/
if (WURFL_Handlers_Utils::checkIfContains($userAgent, "ObigoInternetBrowser/Q03C") || WURFL_Handlers_Utils::checkIfContains($userAgent, "AU-MIC/2") || WURFL_Handlers_Utils::checkIfContains($userAgent, "AU-MIC-") || WURFL_Handlers_Utils::checkIfContains($userAgent, "AU-OBIGO/") || WURFL_Handlers_Utils::checkIfContains($userAgent, "Obigo/Q03") || WURFL_Handlers_Utils::checkIfContains($userAgent, "Obigo/Q04") || WURFL_Handlers_Utils::checkIfContains($userAgent, "ObigoInternetBrowser/2") || WURFL_Handlers_Utils::checkIfContains($userAgent, "Teleca Q03B1")) {
return WURFL_Constants::GENERIC_XHTML;
}
//web browsers?
$mozzilas = array("Mozilla/4", "Mozilla/5", "Mozilla/6");
if (WURFL_Handlers_Utils::checkIfStartsWithOneOf($userAgent, $mozzilas)) {
return "generic_web_browser";
}
/**
* Mozilla of some kind
*/
if (WURFL_Handlers_Utils::checkIfContains($userAgent, "Mozilla")) {
return WURFL_Constants::GENERIC_XHTML;
}
// DoCoMo
if (strpos($userAgent, "DoCoMo") === 0 || strpos($userAgent, "KDDI") === 0) {
return "docomo_generic_jap_ver1";
}
return WURFL_Constants::GENERIC;
}