So i started learning facebook sdk and i wanted to get attening_count/list from my event page as an array, but i'm unable to get it working. It only displays me id, name etc.
if (isset($_SESSION['access_tok'])) {
echo '<a href="out.php">Out!</a><br>';
try {
$response = $fb->get('me/accounts?fields=', $_SESSION['access_tok']);
$page = $response->getGraphEdge();
} catch(Facebook\Exceptions\FacebookResponseException $e) {
// When Graph returns an error
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
// When validation fails or other local issues
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
foreach($page as $pages)
{
$name = $pages['name'];
$cc = $pages['access_token'];
if($name == 'Testing')
{
try {
$response1 = $fb->get('/eventid', $cc);
$page1 = $response1->getGraphNode()->asArray();
} catch(Facebook\Exceptions\FacebookResponseException $e) {
// When Graph returns an error
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
// When validation fails or other local issues
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$page1 ['id'];
}
else
{
}
}
}