I have this code that get me last status on facebook:-
<?php
/*---------------------------------------------------------------------------------*/
# Gets the data from a URL
/*---------------------------------------------------------------------------------*/
function get_data($url) {
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
$data = get_data("[url]");
$result = json_decode($data);
$latest_post = $result->data[0];
$latest_post_text = $latest_post->message;
$latest_post_link = $latest_post->actions[0]->link;
?>
When I print like this :-
<a href="<?php echo $latest_post_link ?>"><?php echo $latest_post_text ?></a>
Its Show me only last status. i need to get me last 3 status. how can i do that ??