yahoo and google get result number from HTML


/ Published in: PHP
Save to your folder(s)

this is from openbusiness.cc statistics code.


Copy this code and paste it in your HTML
  1. function get_number($url){
  2. $fp = @fopen("$url", "r");
  3. if($fp){
  4. while($in = fread($fp, 1024))
  5. $reply .= $in;
  6. fclose($fp);
  7. if(ereg("of about <strong>(.*)</strong> for", $reply, $reg))
  8. return str_replace(",","",$reg[1]);
  9. else
  10. return "ERR: No result!";
  11. }
  12. return "Error : Could not connect to website!";
  13. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.