本文整理匯總了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;
}