【发布时间】:2018-05-18 07:28:15
【问题描述】:
我想使用geoplugin。但当前的地理插件在json 中显示数据。但是如何在WordPress function 中使用这个json 代码
hear example json
{
"geoplugin_request": "122.180.85.165",
"geoplugin_status": 200,
"geoplugin_delay": "2ms",
"geoplugin_credit": "Some of the returned data includes GeoLite data created by MaxMind, available from <a href='http://www.maxmind.com'>http://www.maxmind.com</a>.",
"geoplugin_city": "Ludhiana",
"geoplugin_region": "Punjab",
"geoplugin_regionCode": "PB",
"geoplugin_regionName": "Punjab",
"geoplugin_areaCode": "",
"geoplugin_dmaCode": "",
"geoplugin_countryCode": "IN",
"geoplugin_countryName": "India",
"geoplugin_inEU": 0,
"geoplugin_continentCode": "AS",
"geoplugin_continentName": "Asia",
"geoplugin_latitude": "30.9",
"geoplugin_longitude": "75.85",
"geoplugin_locationAccuracyRadius": "100",
"geoplugin_timezone": "Asia/Kolkata",
"geoplugin_currencyCode": "INR",
"geoplugin_currencySymbol": "₨",
"geoplugin_currencySymbol_UTF8": "₨",
"geoplugin_currencyConverter": 67.9875
}
【问题讨论】:
-
是什么让您无法运行
json_decode将 JSON 数组解析为 PHP 数组? -
我知道
json_decode但如何在 WordPress 中使用以及如何创建 WordPress 功能。请解释一下 -
您到底在寻找什么? Wordpress 是用 PHP 编写的,你可以直接使用任何 PHP 方法
-
我想在我的网站上获取当前用户位置