How to get no of followers on twitter using PHP

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 35
Joined: Thu Jun 28, 2012 2:11 pm

Tue Mar 05, 2013 1:48 am

Try this code:

<?php $url = "<your_twitter_name>";

$response = file_get_contents($url, true);

$t_profile = new SimpleXMLElement($response);

$count = $t_profile->followers_count;

echo $count." Followers";


Just make sure that in your php extensions->php_openssl is active. If not than change its state to active and restart all services of your apache.

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests