Created
February 25, 2019 15:15
-
-
Save bjwschaap/2dfa175d47fcade4e5090b1dd75b4c5b to your computer and use it in GitHub Desktop.
Example PHP script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header('Vary: Accept-Language'); | |
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); | |
switch ($lang) { | |
case "en": | |
header('Content-Language: en-US'); | |
echo "Hello World!"; | |
break; | |
case "nl": | |
header('Content-Language: nl-NL'); | |
echo "Hallo Wereld!"; | |
break; | |
default: | |
echo "?????????????"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment