如何通过API

时间:2015-07-18 06:09:56

标签: php

如何通过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'));

1 个答案:

答案 0 :(得分:2)

你可以尝试

$detailsId=json_decode(file_get_contents('http://ipinfo.io/'.$_SERVER['REMOTE_ADDR']));

获取您所在国家/地区的数据,然后致电

https://restcountries.eu/rest/v1/name/india

您还可以获得所需的货币和数据。

相关问题