PHP Tarayıcı Dilini Alma

mxaksoy

Banned
31 Tem 2018
16
0
0
Pendik
safyazar.xyz
PHP:
function lanegeSet()
{
	$hi_code = "";
	$hi_quof = 0;
	$langs = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
	foreach($langs as $lang)
	{
		list($codelang,$quoficient) = explode(";",$lang);
		if($quoficient == NULL) $quoficient = 1;
		if($quoficient > $hi_quof)
		{
			$hi_code = substr($codelang,0,2);
			$hi_quof = $quoficient;
		}
	}
	return $hi_code;
}
$lanegeSVar = lanegeSet();
 

Benzer konular