get - > Domain nama IP

Discussion in 'PHP' started by redhits, Oct 9, 2007.

  1. #1
    Is there any function to get the domain name IP , except using curl,etc?
     
    redhits, Oct 9, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    You mean like
    
    $ip = gethostbyname('www.example.com');
    
    PHP:
    ?
     
    nico_swd, Oct 9, 2007 IP
    redhits likes this.
  3. redhits

    redhits Notable Member

    Messages:
    3,023
    Likes Received:
    277
    Best Answers:
    0
    Trophy Points:
    255
    #3
    thx, man , can you help in the other thread? i want to add something after each link , like

    $website=file_get_contents('http://google.com');
    $website = preg_replace( '/<.*href="?(.*:\/\/)?([^ \/]*)([^ >"]*)"?[^>]*>(.*)(<\/a>)/', '<a href="$1$2$3">$4</a> [$2]', $website );


    echo $website;



    but it's not working... to good
     
    redhits, Oct 9, 2007 IP