RE: [PHP] Simple String Handling
| From: | o dot cook at etoncollege dot org dot uk | Date: | Fri, 22 Dec 2000 15:02:44 +0000 |
| Subject: | RE: [PHP] Simple String Handling | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-31577@lists.php.net to get a copy of this message | ||
Thank you to all who replied. I chose this solution as the easiest to work
with:
$tld = substr(strstr($fulldomain, '.'), 1); # Get
top-level domain
$offset = strpos($fulldomain, '.'); #
Work out where the first '.' is
$domain = substr($fulldomain, 0, $offset); # Take
everything before $offset as the domain
Regards,
Ollie