Guest User

Untitled

a guest
Jun 20th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.28 KB | None | 0 0
  1. // PHP Browser Language Detect
  2. <?php $lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); ?>
  3.  
  4. // Load Result into Variable
  5. <script type="text/javascript">
  6.     <?php if ($lang) { ?>
  7.     $().ready(function () {
  8.         window.lang.change('<?php echo($lang); ?>');
  9.     });
  10.     <? } ?>
  11. </script>
Add Comment
Please, Sign In to add comment