flags
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
// IMAGE PATH
// Set the absolute path to the images here
// Do not forget to start with http:// (or something similar) and do not end with a slash
// You may also use a relative path but this might limit the flexibility of the script
$flags_path = 'http://server.monstagames.nl:81/Flags';
// Default: $flags_path = 'http://server.monstagames.nl:81/Flags';
// Absolute: $flags_path = '.';
$flags_array = file($flags_path.'/flags');
foreach($flags_array as $key => $value)
{
$flags_array[$key] = trim($value);
}
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) and strlen($_SERVER['HTTP_ACCEPT_LANGUAGE']) >= 2)
{ $flags_language = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2); }
else
{ $flags_language = 'empty'; }
if (in_array($flags_language, $flags_array))
{ echo '<img src="'.$flags_path.'/'.$flags_language.'.gif" title="'.$flags_language.'">'; }
else
{ echo '<img src="'.$flags_path.'/empty.gif" title="'.$flags_language.'">'; }
?>
// IMAGE PATH
// Set the absolute path to the images here
// Do not forget to start with http:// (or something similar) and do not end with a slash
// You may also use a relative path but this might limit the flexibility of the script
$flags_path = 'http://server.monstagames.nl:81/Flags';
// Default: $flags_path = 'http://server.monstagames.nl:81/Flags';
// Absolute: $flags_path = '.';
$flags_array = file($flags_path.'/flags');
foreach($flags_array as $key => $value)
{
$flags_array[$key] = trim($value);
}
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) and strlen($_SERVER['HTTP_ACCEPT_LANGUAGE']) >= 2)
{ $flags_language = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2); }
else
{ $flags_language = 'empty'; }
if (in_array($flags_language, $flags_array))
{ echo '<img src="'.$flags_path.'/'.$flags_language.'.gif" title="'.$flags_language.'">'; }
else
{ echo '<img src="'.$flags_path.'/empty.gif" title="'.$flags_language.'">'; }
?>