如何使用php-sdk中的访问令牌获取用户个人资料信息 [英] How to get user profile info using access token in php-sdk

查看:209
本文介绍了如何使用php-sdk中的访问令牌获取用户个人资料信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用我已经生成的访问令牌获取用户个人资料,如果访问令牌无效,则会显示错误。任何人都可以帮忙做到这一点我想要php代码来处理这个。我正在等待....

I want to get user profile using access token that i have already generated, and if the access token is invalid it shoud display error. anyone can help to do this ? i want php code to handle this. i am waiting....

推荐答案

由于您已经拥有访问令牌,最简单干净的方式将是 -

Since you already have the access token, the simplest and clean way would be-

$user_details = "https://graph.facebook.com/me?access_token=" .$access_token;

$response = file_get_contents($user_details);
$response = json_decode($response);
print_r($response);

这篇关于如何使用php-sdk中的访问令牌获取用户个人资料信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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