Posted by gosha bine on 07/10/07 10:20
On 09.07.2007 21:29 laredotornado@zipmail.com wrote:
> Hi,
>
> I'm using PHP 4.4.4. What is the best way (I assume regular
> expressions would be involved) to get the domain from the
> $_SERVER['HTTP_REFERER'] variable? By "domain" I am referring to (for
> example), google.com, instead of groups.google.com. In other words, I
> don't care about sub-domains.
>
> Thanks, - Dave
>
perhaps
'~[\w-]+\.\w+(?=/|$)~'
--
gosha bine
extended php parser ~ http://code.google.com/p/pihipi
blok ~ http://www.tagarga.com/blok
[Back to original message]
|