In joomla iam using this php code to get language prefix in joomla :
$lang = substr(JFactory::getLanguage()->getTag(), 0,2)
What this code do is extract prefix languages :
es
fr
en
it
I need to add something to this code so if the extracted = en remove it
If you need it in one line without a condition:
$lang = str_replace('en', '', substr(JFactory::getLanguage()->getTag(), 0, 2));