11-25-2007, 02:03 AM
|
#5 (permalink)
|
|
The Frequenter
Join Date: Sep 2007
Posts: 360
Thanks: 24
|
Quote:
Originally Posted by Andrew
Well, what you could do.. is just use explode. Make sure the domain is formatted like: www.domain.com.uk or whatever (without slashes or beginning http://), and then just do this:
PHP Code:
/* First get rid of http:// and trailing slash */ $szDomain = 'www.domain.co.uk'; $szKeyword = explode('.', $szDomain); echo $szKeyword[2];
The only error I see this having, if they enter something like: www.sub.domain.com for example, but even then, they shouldn't have the www in front, so it would still work.
|
Erm, I will try but I would prefer a more cleaner version. I'm heading for sleep and might think good solutions in the morning. ;)
Thanks, though.
|
|
|
|