Posted By

ringo on 07/16/06


Tagged

html google yahoo


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

skywalker
carlosabargues
vali29
voove


yahoo and google get result number from HTML


 / Published in: PHP
 

this is from openbusiness.cc statistics code.

  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  

You need to login to post a comment.