如何访问阵列以获取电子邮件地址?我试过像“$ userInfo-> ['email'];
这样的东西$userInfo = $facebook -> api("/$user"); print_r($userInfo);
输出:
Array (
[id] => 1790302499
[name] => Lorem Ipsum
[first_name] => Lorem
[last_name] => Ipsum
[link] => http://www.facebook.com/Lorem.Ipsum
[username] => Lorem.Ipsum
[birthday] => 11/11/1991
[location] => Array (
[id] => 114304221920174
)
[work] => Array (
[0] => Array (
[employer] => Array (
[id] => 114304221920174
[name] => Google.com
)
[start_date] => 0000-00
)
)
[gender] => male
[email] => lorem.ipsum@yahoo.com
[verified] => 1
)
提前谢谢!!
答案 0 :(得分:2)
数组 - $userInfo['email']
对象 - $userInfo->email