How can I remove from this array the current selected language:
$lang = 'en-US';
$languages = array('LANG001' => 'en-US', 'LANG002' => 'es-ES', 'LANG003' => 'fr-CA');
I try with unset($languages[$lang])
without success.
Thanks.
How can I remove from this array the current selected language:
$lang = 'en-US';
$languages = array('LANG001' => 'en-US', 'LANG002' => 'es-ES', 'LANG003' => 'fr-CA');
I try with unset($languages[$lang])
without success.
Thanks.
try:
unset($languages[array_search($lang,$languages,true)]);