Advertisement
Guest User

Untitled

a guest
Mar 9th, 2015
225
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.28 KB | None
  1. $pagina = 'Stack Overflow';
  2. $url_post = str_replace(' ', '', $pagina);
  3. $file = file_get_contents('http://graph.facebook.com/?ids='. $url_post);
  4. $jsonObj = json_decode($file);
  5.  
  6. $fbcount = number_format($jsonObj->{$url_post}->{'likes'});
  7. echo "A página $pagina tem $fbcount curtidas";
Advertisement
RAW Paste Data Copied
Advertisement