$scriptlang = "<script> var langjs = (navigator.language).substr(0, 2).toLowerCase();</script>"; echo $lang;