How to generate url with language code in drupal7? Is there any drupal function to return the url with currently used language.
Like: example.com/en
You can get the URL by using following code

global $language ;
$lang_name = $language-&gt;language ;

$url_current = $GLOBALS['base_url']/$lang_name;