Strip URL down to just domain

Discussion in 'PHP' started by adzeds, Feb 4, 2010.

  1. #1
    adzeds, Feb 4, 2010 IP
  2. beacon

    beacon Peon

    Messages:
    93
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    $host = parse_url('http://www.eaguingamp.co.uk/2010/0..', PHP_URL_HOST);
    $host = preg_replace('~^www\.~i', '', $host);
     
    beacon, Feb 4, 2010 IP
  3. adzeds

    adzeds Well-Known Member

    Messages:
    1,209
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    100
    #3
    That was quick. Good work!
     
    adzeds, Feb 4, 2010 IP