KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I keep getting the error in the title, while using a simple code: require_once('sdk/src/facebook.php'); require_once("AppInfo.php"); function idx(array $array, $key, $default = null) { return array_key_exists($key, $array) ? $array[$key] : $default; } function he($str) { return htmlentities($str, ENT_QUOTES, "UTF-8"); } $facebook = new Facebook(array( 'appId' => AppInfo::appID(), 'secret' => AppInfo::appSecret(), 'sharedSession' => true, 'trustForwarded' => true, )); $arrayForJSON=array(); $user = $facebook->getUser(); $friends = idx($facebook->api('/me/friends'), 'data', array()); if ($friends) { $arrayForJSON['friends']=$friends; } print_r($friends); I really don't know how to solve it, I've been searching and trying many answers on stackoverflow
Tags (comma-separated)
Save Edits
Cancel