php - href and span in dropdown menu -


in current situation have languageselector on our website allows people choose between 2 languages clicking corresponding flag. however, want change dropdown due new languages being added, preferably name of language in it.

here's current code + effort:

    echo "<div id='languages-container'>"; // show language switcher foreach($translationcontroller->getlanguages() $language){     $isssl = (!empty($_server['https']) && $_server['https'] !== 'off') || $_server['server_port'] == 443;     $path = 'http'.(($isssl) ? 's' : '').'://' . $_server['http_host'] . strip_tags($_server['request_uri']);     $path = (strpos("x".$path,'?') !== false) ? substr($path, 0, strpos($path, "?")) : $path;     $path.= "?lang=" . $language;     $selected = $_cookie['webba_translator_language'] == $language ? 'selected' : '';     echo "<a href='{$path}'><span class='language {$language} {$selected}'></span></a>";     }    //15-9 test, not working echo "<select>     <option><a href='{$path}'><span class='language {$language} '></span>english</option>     <option><a href='{$path}'><span class='language {$language} '></span>nederlands</option>     </select>";    echo "</div>"; 

and css:

#languages-container .language {     width: 20px;     height: 20px;     float: left;     margin: 2.5px 5px;     background-position: center center;     background-size: cover; } #languages-container .language.selected {     outline: 2px solid black;     outline-offset: 3px; }  .language.nl_nl {     background-image: url('../img/lang/nl_nl.png'); } .language.en_us {     background-image: url('../img/lang/en_us.png'); } 

it wip formatting on todo list.. question is: how can flags dropdown list instead of 2 clickable icons?

thanks!


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -