mercredi 15 octobre 2014

  1. function bing_backs($url){ // to get backilinks
  2. $url = "http://www.bing.com/search?q=link%3A%20$url";
  3. $total = file_get_contents($url);
  4. $match_expression = '/<span class="sb_count" id="count">(.*?)<\\/span><\/div>/im';
  5. // preg_match($match_expression,$total,$matches);
  6. preg_match_all($match_expression, $total, $matches);
  7. echo $n_clean=$matches[1];
  8. return $n_clean=clean_me($n_clean);
  9. }
  10. function clean_me($numb){ // to clean the reutrn numbers remove coma (,) etc
  11. return $clean_num=str_replace(",", "", $numb);
  12. }
  13. $url="www.youtube.com";
  14. echo bing_backs($url); // not working regex seems to be ok to me

Aucun commentaire:

Enregistrer un commentaire