<?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.'">'; }

?>