Subversion Repositories ALCASAR

Rev

Rev 2054 | Rev 2150 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2054 Rev 2099
Line 60... Line 60...
60
	{
60
	{
61
		echo $resultat[$i]."\n";
61
		echo $resultat[$i]."\n";
62
	}
62
	}
63
}
63
}
64
 
64
 
65
#maximum length for top-level DNS
-
 
66
function max_tld()
-
 
67
{
-
 
68
	$url_tld = "http://data.iana.org/TLD/tlds-alpha-by-domain.txt";
-
 
69
	$result_tld = file_get_contents($url_tld,false);
-
 
70
	$max_tld = 18; 							#valeur de base si le site ne répond plus
-
 
71
	if($result_tld !== FALSE){
-
 
72
		foreach(explode("\n", $result_tld) as $line)
-
 
73
		{
-
 
74
			if((strpos($line,'-') === false) and (strpos($line,'#') === false))
-
 
75
			{
-
 
76
				if(strlen($line) > $max_tld)
-
 
77
				{
-
 
78
					$max_tld = strlen($line);
-
 
79
				}
-
 
80
			}
-
 
81
		}
-
 
82
	}
-
 
83
	return $max_tld;
-
 
84
}
-
 
85
 
-
 
86
# Choice of language
65
# Choice of language
87
$Language = 'en';
66
$Language = 'en';
88
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
67
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
89
	$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
68
	$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
90
	$Language = strtolower(substr(chop($Langue[0]),0,2)); 
69
	$Language = strtolower(substr(chop($Langue[0]),0,2));