问题描述
我想在wordpress中查看前端的json数据。
数据不显示,有人可以帮我吗?
add_shortcode( 'external_data-2','callback_function_name_bis');
function callback_function_name_bis() {
$url = 'https://www.thesportsdb.com/api/v1/json/1/eventsnextleague.php?id=4334';
$data = file_get_contents($url);
$results = json_decode($data,true);
foreach($results as $result){
echo $result['events'][0]['strEvent'];
}
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)