How to show twitter followers using php code

    Use the following code to show the followers list you can theme your output by using suitable HTML inside foreach()
    <?php
    //Replace <SCREENNAME> with twitter screen name
    $twitter_url = "http://api.twitter.com/1/statuses/followers/<SCREENNAME>.json";

    $chrequest = curl_init();

    curl_setopt($chrequest, CURLOPT_URL, $twitter_url);

    curl_setopt($chrequest, CURLOPT_RETURNTRANSFER, 1);

    $curloutput = curl_exec($chrequest);

    curl_close($chrequest);

    $res = json_decode($curloutput, true);
    $output = '<ul>';
    foreach(
    $res as $followers){

    $thumbnail = $followers['profile_image_url'];

    $profile_path = $followers['screen_name'];

    $twittername = $followers['name'];

    $output .= '<li><a title="'. $twittername .'" href="http://www.twitter.com/'. $profile_path.'"><img class="twit-pic" src="'. $thumbnail .'" border="0" alt="" width="40" /></a></li>';

    $output = '</ul>';

    print
    $output;
    ?>
    5
    Average: 5 (1 vote)