文件获取内容再次无法正常工作 [英] file get contents again not working alternative

查看:167
本文介绍了文件获取内容再次无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图curl作为filegetcontents现在工作在php可以任何一个给我的解决方案所以解决它使用curl这里是代码

I tried the curl as the filegetcontents now working in php can any one give me the solution so solve it using curl here is the code

$userData = json_decode(file_get_contents('https://graph.facebook.com/me?access_token='.$token.'&fields=name,id'),true);
print($userData[id]).'<br/>';


推荐答案

尝试:

$json = json_decode(file_get_contents('https://graph.facebook.com/me?access_token='.$token.'&fields=name,id'),true);
$json_output = json_decode($json, true);

现在您可以像这样获得特定项目:

Now you can get specific item like this:

echo $json_output['id'];  

这篇关于文件获取内容再次无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆