Facebook应用程序使用php api获取用户名 [英] facebook application get the username using php api

查看:100
本文介绍了Facebook应用程序使用php api获取用户名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现使用file_get_contents,如

i 've found using file_get_contents like

json_decode(file_get_contents('http://graphdotfacebookdotcom/'.$uid));

json_decode(file_get_contents('http://graphdotfacebookdotcom/'.$uid));

将使我的应用程序加载速度很慢,有没有办法检索Facebook用户的用户名?

will make my application very slow to load, are there any methods to retrieve the username of the facebook user?

谢谢

推荐答案

$facebook = new Facebook(array(
'appId'  => $APIappId,
'secret' => $APIsecret,
'cookie' => true
 ));
$facebook->api('/'.$uid);

不要忘记在顶部添加facebook.php

Don't forget to include facebook.php at the top

这篇关于Facebook应用程序使用php api获取用户名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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