« Create PDF file with PHPRegex Validation in PHP »
<?php
$current = "http://search.twitter.com/trends/current.json";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $current);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
$ce = curl_exec($c);
$trends = json_decode($ce,1);
$trends = array_values(array_values($trends["trends"]));
//print_r($trends[0]);
foreach ($trends[0] as $trend) {
echo $trend["name"] . " ";
}
curl_close($c);
?>
Write tutorial on a topic you are good in and become a trusted PHP jabber! Share your knowledge with thousands of webmasters and we will reward you for your generosity by giving you bonus points which you can use as a voucher to buy any of our commercial products. Read more about our reward program.
2 Replies to "PHP and The Twitter API"