本文整理汇总了PHP中UserAgentUtils::ldMatch方法的典型用法代码示例。如果您正苦于以下问题:PHP UserAgentUtils::ldMatch方法的具体用法?PHP UserAgentUtils::ldMatch怎么用?PHP UserAgentUtils::ldMatch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserAgentUtils
的用法示例。
在下文中一共展示了UserAgentUtils::ldMatch方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ldMatch
/**
* Attempts to match given user agent string to a device from the database by calculating their Levenshtein Distance (LD)
* @param int $tolerance Tolerance, how much difference is allowed
* @return string WURFL ID
*/
public function ldMatch($tolerance = null)
{
if ($this->simulation) {
return WurflConstants::NO_MATCH;
}
if ($this->wurfl->db->db_implements_ld) {
return $this->wurfl->db->getDeviceFromUA_LD($this->userAgent->normalized, $tolerance, $this);
}
$this->updateDeviceList();
return UserAgentUtils::ldMatch($this->userAgent->normalized, $tolerance, $this);
}
示例2: ldMatch
/**
* Attempts to match given user agent string to a device from the database by calculating their Levenshtein Distance (LD)
* @param String User agent
* @param int Tolerance, how much difference is allowed
* @return String WURFL ID
*/
public function ldMatch($ua, $tolerance = NULL)
{
if ($this->wurfl->db->db_implements_ld) {
return $this->wurfl->db->getDeviceFromUA_LD($ua, $tolerance, $this);
}
$this->updateDeviceList();
return UserAgentUtils::ldMatch($ua, $tolerance, $this);
}