如何通过API在php中获取India(+91)
等国家/地区代码
无法找到
$detailsId=json_decode(file_get_contents('http://ipinfo.io/'.$_SERVER['REMOTE_ADDR']));
我得到了这个。
$idd=json_decode(file_get_contents('https://restcountries.eu/rest/v1/alpha?codes=IN'));
你可以试试
$detailsId=json_decode(file_get_contents('http://ipinfo.io/'.$_SERVER['REMOTE_ADDR']));
获取你所在国家的数据,你可以调用
https://restcountries.eu/rest/v1/name/india
您还可以获取所需的货币和数据。