<?php
/* return result number */
function get_google_results($domain = 'vijayjoshi.org')
{
// get the result content
$content = file_get_contents('http://www.google.com/search?q=site:'.$domain);
// parse to get results
$result = get_match('/Results <b>(.*)from/isU',$content);
// echo $result;
// split the results
$split1 = explode('of about',$result);
// return result
return $split1[1] ? strip_tags($split1[1]) : 0;
}
/* helper: does the regex */
function get_match($regex,$content)
{
preg_match($regex,$content,$matches);
return $matches[1];
}
/* do it! */
echo 'vijayjoshi.org: '.get_google_results('vijayjoshi.org'); // 164
//echo 'Philogy.com: '.get_google_results('philogy.com'); // 164
?>
Secure file download in PHP, Security question PHP, PHP MYSQL Interview Question -Books download - PHP solutions guidelines queries update, phpmysqlquestion
Subscribe to:
Post Comments (Atom)
security header validate
HTTP Security Headers Check Tool - Security Headers Response (serpworx.com)
-
QUESTION: 1 What is the output of the following code? echo '1' . (print '2') + 3; A. 123 B. 213 C. 142 D. 214 E. ...
-
Windows tool for creating a self-signed certificate. https://sourceforge.net/projects/portecle/ kindly install portecle tool from abov...
-
Which pillar of the AWS Well-Architected Framework recommends maintaining infrastructure as code? Operational Excellence Which of the foll...
No comments:
Post a Comment