How To Get the Facebook Like Share Comment Count for the Given URL in PHP

Get the Facebook Like Share Comment Count for the Given URL in PHP using the Facebook Query Language (FQL). Sometimes we need to find like,share,comment count for show a snippet at out web page.By using the following code you can get the facebook fan page count too.The following code very simple and just pass the url of the web page to function, then it will return you the values in the json format.

Get the Facebook Like Share Comment Count for the Given URL in PHP

Us e the following PHP code then it will return you the values like,

  • Facebook Likes count of URL.
  • Facebook Share count of URL.
  • Facebook Comment count of URL.
  • Facebook Click count for the particular URL.
  • Total count of all the above.

PHP Source Code

Just copy paste the above function code in your php script.

Code Usage & output