= $check_date) {
require_once dirname(__FILE__).'/index_view_20240221.html';
} else{
require_once dirname(__FILE__).'/index_view_asis.html';
}
exit;
$params = array(
'query' => $_SERVER['REMOTE_ADDR'],
'serviceKey'=> 'cpFZ78oji2DpVu3xJ3v8ZXvx1PA3pkIaTWy0+vkHnARtvWAWsL1yz2T1/KitXHxUtD4FPYQQrQXscTZ5l+P20A==',
'answer' => 'JSON'
);
$url = "http://apis.data.go.kr/B551505/whois/ipas_country_code" . "?" . http_build_query($params, '', '&');
$ch = curl_init(); //curl 초기화
curl_setopt($ch, CURLOPT_URL, $url); //URL 지정하기
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //요청 결과를 문자열로 반환
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); //connection timeout 10초
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //원격 서버의 인증서가 유효한지 검사 안함
$response = curl_exec($ch);
curl_close($ch);
$decodeJsonData = json_decode($response, true);
$countryCode = trim($decodeJsonData['response']['whois']['countryCode']);
if($countryCode == "KR"){
//echo "한국";
}else if($countryCode == "CN"){
//echo "중국";
}else{
//echo "미국";
}
?>
2023 LG에너지솔루션 글로벌 대학생 크리에이터