PrivateBin\I18n::_matchLanguage PHP Method

_matchLanguage() protected static method

From: https://stackoverflow.com/questions/3770513/detect-browser-language-in-php#3771447
protected static _matchLanguage ( string $a, string $b ) : float
$a string
$b string
return float
    protected static function _matchLanguage($a, $b)
    {
        $a = explode('-', $a);
        $b = explode('-', $b);
        for ($i = 0, $n = min(count($a), count($b)); $i < $n; ++$i) {
            if ($a[$i] !== $b[$i]) {
                break;
            }
        }
        return $i === 0 ? 0 : (double) $i / count($a);
    }