public 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 : (float) $i / count($a);
    }
public 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 : (float) $i / count($a);
    }
public 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 : ( float ) $ i / count ( $ a ) ; }
compare two language tags and distinguish the degree of matching
compare two language tags and distinguish the degree of matching