Any PHP gurus around here?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • x3m
    Confirmed User
    • May 2001
    • 256

    #1

    Any PHP gurus around here?

    How do I extract the "domain.tld" string from the HTTP_REFERER variable.

    In other words how do I strip all other stuff from the variable and keep "domain.tld" only.

    Thanks in advance.
  • Sly_RJ
    Live Hard - Die Hard
    • Feb 2002
    • 17042

    #2
    For one, you could use a split.

    Or you could count backwards 10 characters, I forget the damn command though. It's been a while since I've written anything.
    PHAT SERVERS - Quality dedicated hosting at a quality price!
    sly AT phatservers DOT com - 147479144

    Comment

    • Lane
      Will code for food...
      • Apr 2001
      • 8496

      #3
      http://www.php.net/manual/en/function.parse-url.php

      Comment

      • x3m
        Confirmed User
        • May 2001
        • 256

        #4
        Thanks!

        parse_url ( string url) is exactly what I needed.

        Comment

        • Tipsy
          Confirmed User
          • Jul 2001
          • 6989

          #5
          Glad I'm not the only one sitting here learning it ATM. It's actually easier than I'd hoped....so far.
          Ignorance is never bliss.

          Comment

          Working...