I am trying to figure out how to pull data out of a string. This is
 driving me crazy. I figure an if statement of some sort would work but
 I'm not sure how to structure it.

I know how to get what I want if it is just
$fullhostname = "www.domain.net";
$exp = explode(".", $fullhostname);

$host = $exp[0];
$domain = $exp[1];
$tld = $exp[2];


 But what if it looks like this
$fullhostname = "www.mysit.dom.net";
I need
$host= www
$domain = mysit.dom
$tld = net

or this
$fullhostname = "mysite.domain.net";
$host =
$domain = mysite.domain
$tld = net

Or even worse this
$fullhostname = "mysit.dom.net";

$host =
$domain = mysit.dom
$tld = net








Best regards,
 Richard  
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]

Reply via email to