1.0) { $val = 1.0; } $possibilities [$matches [1]] = $val; } } arsort ($possibilities); foreach ($possibilities as $lang => $value) { if (isset ($translations [$lang])) { return $lang; } } } return "en"; // nothing found; default to english } function other_languages ($current_lang) { $script = pathinfo ($_SERVER ["SCRIPT_NAME"], PATHINFO_FILENAME); $dotpos = strpos ($script, '.'); if ($dotpos !== false) { $script = substr ($script, 0, $dotpos); } global $translations; $links = Array (); foreach ($translations as $lang => $obj) { $lang_name = $obj ["_language_name"]; if ($lang == $current_lang) { array_push ($links, "$lang_name"); } else { array_push ($links, "$lang_name"); } } echo "