Tijnema wrote:
On 6/7/07, Brad Fuller [EMAIL PROTECTED] wrote:
Robin Vickery wrote:
In that case you can't do it just by parsing alone, you need to use
DNS.
?php
function get_domain ($hostname) {
dns_get_record($hostname, DNS_A, $authns, $addt); return
$authns[0]['host']; }
On 06/06/07, Brad Fuller [EMAIL PROTECTED] wrote:
Daniel Brown wrote:
On 6/6/07, Brad Fuller [EMAIL PROTECTED] wrote:
I need to strip out a domain name from a URL, and ignore subdomains
(like www)
I can use parse_url to get the hostname. And my first thought was to
take the last 2
On 6/7/07, Robin Vickery [EMAIL PROTECTED] wrote:
On 06/06/07, Brad Fuller [EMAIL PROTECTED] wrote:
Daniel Brown wrote:
On 6/6/07, Brad Fuller [EMAIL PROTECTED] wrote:
I need to strip out a domain name from a URL, and ignore subdomains
(like www)
I can use parse_url to get the
Robin Vickery wrote:
In that case you can't do it just by parsing alone, you need to use
DNS.
?php
function get_domain ($hostname) {
dns_get_record($hostname, DNS_A, $authns, $addt); return
$authns[0]['host']; }
print get_domain(www.google.com) . \n; print
get_domain(google.com) .
On 6/7/07, Brad Fuller [EMAIL PROTECTED] wrote:
Robin Vickery wrote:
In that case you can't do it just by parsing alone, you need to use
DNS.
?php
function get_domain ($hostname) {
dns_get_record($hostname, DNS_A, $authns, $addt); return
$authns[0]['host']; }
print
Hey guys,
I'm faced with an interesting problem, and wondering if there's an easy
solution.
I need to strip out a domain name from a URL, and ignore subdomains (like
www)
I can use parse_url to get the hostname. And my first thought was to take
the last 2 segments of the hostname to get the
On Wed, 2007-06-06 at 11:43 -0400, Brad Fuller wrote:
Hey guys,
I'm faced with an interesting problem, and wondering if there's an easy
solution.
I need to strip out a domain name from a URL, and ignore subdomains (like
www)
I can use parse_url to get the hostname. And my first thought
On 6/6/07, Brad Fuller [EMAIL PROTECTED] wrote:
Hey guys,
I'm faced with an interesting problem, and wondering if there's an easy
solution.
I need to strip out a domain name from a URL, and ignore subdomains (like
www)
I can use parse_url to get the hostname. And my first thought was to take
Daniel Brown wrote:
On 6/6/07, Brad Fuller [EMAIL PROTECTED] wrote:
Hey guys,
I'm faced with an interesting problem, and wondering if there's an
easy solution.
I need to strip out a domain name from a URL, and ignore subdomains
(like www)
I can use parse_url to get the hostname. And
Hi Brad,
Wednesday, June 6, 2007, 5:04:41 PM, you wrote:
Yes, that's basically what my code already does.
The problem is that what if the url is http://yahoo.co.uk/; (note the lack
of a subdomain)
Your script thinks that the domain is co.uk. Just like my existing code
does.
So we can't
From: Brad Fuller [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 06, 2007 5:44 PM
Subject: [PHP] Parse domain from URL
Hey guys,
I'm faced with an interesting problem, and wondering if there's an easy
solution.
I need to strip out a domain name from a URL, and ignore subdomains
11 matches
Mail list logo