Home » , » How to write a PHP script to find the number of indexed pages in Google?| How To Find Google Index Page Through PHP ?

How to write a PHP script to find the number of indexed pages in Google?| How To Find Google Index Page Through PHP ?

This function will helpful for SEO persons, because they are aware of SEO index term but as a developer we also have knowledge of crawling of websites.

In this php script we will use simple CURL request and get data from google server.

function getGoogleCount($domain) {
    $content = file_get_contents('http://ajax.googleapis.com/ajax/services/' .
        'search/web?v=1.0&filter=0&q=site:' . urlencode($domain));
    $data = json_decode($content);
    return intval($data->responseData->cursor->estimatedResultCount);
}

echo getGoogleCount('Domain.com');

Share this article :

No comments:

Post a Comment

 
Copyright © 2013. Find Anything Online - All Rights Reserved
Proudly powered by Blogger