Check if there links.

Discussion in 'PHP' started by Dor77, Jul 26, 2009.

  1. #1
    *Sorry, my english so bad :)


    I need a function that check if there link in some websie.
    I mean, the function check if there the link: "www.example.com" on the site: "www.blabla.com".

    Thanks, and again, I have bad english :]
     
    Dor77, Jul 26, 2009 IP
  2. Chikey.ru

    Chikey.ru Peon

    Messages:
    50
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    function check($where,$what){
    $t=file_get_contents($where);
    if(preg_match('#<a href="'.$what.'">#',$t,$x)){
    return true;
    }else{
    return false;
    }
    }
     
    Chikey.ru, Jul 26, 2009 IP
  3. chanakya

    chanakya Peon

    Messages:
    361
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    chanakya, Jul 27, 2009 IP