I found one script check index on google if site have indexed
function getPagesIndexedGoogle($site)
{
if ($site) {
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_HEADER => 0,
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => "https://www.google.com.au/search?q=site:$site&gws_rd=ssl",
CURLOPT_SSL_VERIFYPEER=> false,
CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko'
));
$result_string = curl_exec($curl);
curl_close($curl);
if (strpos($result_string, "did not match any documents") !== false) {
return 0;
} else {
$match = preg_match("/about ([0-9,]{0,12})/i", $result_string, $matches);
echo $matches[1];
}
}
}
if($_POST['domain']){
$site = $_POST['domain'];
}
echo $_POST['domain'] ;
echo getPagesIndexedGoogle($site);
?>
How to check mutilple url?
I have used Foreach but it does not work. Please help me.