Hey guys , My names gautam . and i recently started learning PHP because i had to build a small app in Php using the facebook graph API . below is a code snippet that communicates with the fb api to get a list of friends .
[syntax=php]
<?php
require_once(‘config.php’);
$offset = ($_GET[‘offset’])?$_GET[‘offset’]:0;
$limit = 100;
$friends = $facebook->api(‘/me/friends?offset=’ .
$offset . ‘&limit=’ . $limit);
print_r($friends);
if($friends[‘paging’][‘previous’]) {
echo ‘<br><a target=”_top” href=”http://apps.facebook.com/
[your_application_url]/action_paging.php?offset=’ .
($offset-$limit) . ‘”>Previous</a>’;
}
if($friends[‘paging’][‘next’]) {
echo ‘ <a target=”_top” href=”http://apps.facebook.com/
[your_application_url]/action_paging.php?offset=
‘.($offset+$limit).'”>Next</a>’;
}
?>
[/syntax]
can somebody explain to me this line in the code .
[syntax=php]
$offset = ($_GET[‘offset’])?$
[/syntax]