src/Utility/Language.php
protected static function _matchLanguage($a, $b) {
		$a = explode('-', strtolower($a));
		$b = explode('-', strtolower($b));

		for ($i = 0, $n = min(count($a), count($b)); $i < $n; $i++) {
			if ($a[$i] !== $b[$i]) {
				break;
			}
		}
		return $i === 0 ? 0 : (float)$i / count($a);
	}
protected static function _matchLanguage($a, $b) {
		$a = explode('-', strtolower($a));
		$b = explode('-', strtolower($b));

		for ($i = 0, $n = min(count($a), count($b)); $i < $n; $i++) {
			if ($a[$i] !== $b[$i]) {
				break;
			}
		}
		return $i === 0 ? 0 : (float)$i / count($a);
	}
protected static function _matchLanguage ( $ a , $ b ) { $ a = explode ( '-' , strtolower ( $ a ) ) ; $ b = explode ( '-' , strtolower ( $ b ) ) ; for ( $ i = 0 , $ n = min ( count ( $ a ) , count ( $ b ) ) ; $ i < $ n ; $ i ++ ) { if ( $ a [ $ i ] !== $ b [ $ i ] ) { break ; } } return $ i === 0 ? 0 : ( float ) $ i / count ( $ a ) ; }
Compare two language tags and distinguish the degree of matching

@param string $a
@param string $b
@return float
Compare two language tags and distinguish the degree of matching