Este sitio web utiliza cookies para realizar análisis y mediciones de tus visitas. [ Acepto ] [ Más información aquí ].

How to Get Likes from a Facebook Page in PHP

To get the number of all likes received by a Facebook Page, use the following PHP code. Replace "Google" with the name of the page you want:

$page = "Google";

$url = "".$page;

$ch = curl_init($url);


$raw = curl_exec($ch);


$data = json_decode($raw);

$likes = intval($data->likes);

echo $likes;

If the page has numbers in it, use only the numbers to perform the query. For example, for, use:

$page = "269212336568846";

Añadir comentario