How to replace cnet.com with <? echo $website; ?>

Discussion in 'PHP' started by karimian, Feb 18, 2010.

  1. #1
    hi.
    How to replace cnet.com with <? echo $website; ?>
    <?php
    
    $query = "site:mixx.com+linkdomain:cnet.com";
    
    preg_match("/<strong id=\"resultCount\">([0-9,]*)<\/strong> results for<\/span>/", file_get_contents("http://uk.search.yahoo.com/search?p=".$query), $matches);
    
    $numberofresults = $matches[1];
    
    echo $numberofresults;
    ?>
    PHP:

     
    karimian, Feb 18, 2010 IP
  2. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #2
    <?php
    
    $query = "site:mixx.com+linkdomain:".$website;
    
    preg_match("/<strong id=\"resultCount\">([0-9,]*)<\/strong> results for<\/span>/", file_get_contents("http://uk.search.yahoo.com/search?p=".$query), $matches);
    
    $numberofresults = $matches[1];
    
    echo $numberofresults;
    ?>
    PHP:
     
    danx10, Feb 18, 2010 IP