Re: Re[2]: [PHP] Pulling data out of a domain name

2001-12-05 Thread Brian Clark

* [EMAIL PROTECTED] <[EMAIL PROTECTED]> [Dec 05. 2001 18:38]:

> Hello Brian,
> actually no parse_url() will return various components of the URL
> like
> $url[scheme] = http
> $url[host] = www.php.net 
> $url[path] = /download-php.php3 
> $url[query] = csel=br
> I what to split the host name up not the whole URL.

Ahh, so I see now. I guess that's what I get for being in such a hurry.
:-)

You're not using any regular expressions or anything, so I'd just go
with what you had. It's probably not going to be that slow, even on
large lists of domains, for example.

> Wednesday, December 05, 2001, 3:21:38 PM, you wrote:
> 
> >>   Is there a more efficient way of doing what this script does is check
> >>   a domain name and separate the domain name from the ext.
> >>   The domain names could be in a few different formats. Like the
> >>   samples below. This script works but I was just wondering does it
> >>   have to be so long winded
> 
> BC> I think you want parse_url()
> 
> BC> 

-- 
 -Brian Clark


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re[2]: [PHP] Pulling data out of a domain name

2001-12-05 Thread rdkurth

Hello Brian,
actually no parse_url() will return various components of the URL
like
$url[scheme] = http
$url[host] = www.php.net 
$url[path] = /download-php.php3 
$url[query] = csel=br
I what to split the host name up not the whole URL.

Wednesday, December 05, 2001, 3:21:38 PM, you wrote:

BC> * [EMAIL PROTECTED] <[EMAIL PROTECTED]> [Dec 05. 2001 18:05]:

>>   Is there a more efficient way of doing what this script does is check
>>   a domain name and separate the domain name from the ext.
>>   The domain names could be in a few different formats. Like the
>>   samples below. This script works but I was just wondering does it
>>   have to be so long winded

BC> I think you want parse_url()

BC> 




-- 
Best regards,
 rdkurthmailto:[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Pulling data out of a domain name

2001-12-05 Thread Brian Clark

* [EMAIL PROTECTED] <[EMAIL PROTECTED]> [Dec 05. 2001 18:05]:

>   Is there a more efficient way of doing what this script does is check
>   a domain name and separate the domain name from the ext.
>   The domain names could be in a few different formats. Like the
>   samples below. This script works but I was just wondering does it
>   have to be so long winded

I think you want parse_url()



-- 
 -Brian Clark


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Pulling data out of a domain name

2001-12-05 Thread rdkurth

  Is there a more efficient way of doing what this script does is check
  a domain name and separate the domain name from the ext.
  The domain names could be in a few different formats. Like the
  samples below. This script works but I was just wondering does it
  have to be so long winded

  www.domain.com  www.domain.com.au domain.com domain.com.au



   $number= substr_count ($domaname,".");
  If ($number=="1"){
  $host1=explode(".",$domaname);
   $dhost=$host1[0] ;
   $chost=$host1[1] ;
  }
 
 If ($number=="2"){
  $host1=explode(".",$domaname);
 if($host1[0]=="www"){
   $dhost=$host1[1] ;
   $chost=$host1[2] ;
 
  }else{
$dhost=$host1[0] ;
$dhost1=$host1[1] ;
$dhost2=$host1[2] ;
$chost=$dhost1 . "." . $dhost2;
   }}
   If ($number=="3"){
  $host1=explode(".",$domaname);
 if($host1[0]=="www"){
 $dhost1=$host1[0] ;
 $dhost2=$host1[1] ;
 $dhost3=$host1[2] ;
 $dhost4=$host1[3] ;
 $dhost=$dhost2;
 $chost=$dhost3 . "." . $dhost4;
  }else{
 $dhost1=$host1[0] ;
 $dhost2=$host1[1] ;
 $dhost3=$host1[2] ;
 $dhost=$dhost1;
 $chost=$dhost2 . "." . $dhost3;
 }
  }

  

-- 
Best regards,
 rdkurth  mailto:[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]