public static function ct($ip = "true", $lang = "EN", $flag = false) { $get = new self(); //Set Unknown if no result $country = array(); $country['geoplugin_countryCode'] = "ZZ"; //Get real ip if $ip = true $real_ip = $get->realclientip($ip); //Get client data from http://www.geoplugin.net $Clientdata = unserialize($get->ClientData($real_ip)); //check if script get the data if ($Clientdata && $Clientdata['geoplugin_countryName'] != null) { $country = $Clientdata; } // return the name of country and icon condition if ($flag == true) { echo '<link rel="stylesheet" type="text/css" href="flags.css" />'; $class = strtolower($country['geoplugin_countryCode']); return "<i class='flag flag-{$class}'></i>" . $get->ctLang($country, $lang); } else { return $get->ctLang($country, $lang); } }