In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
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
>
> www.domain.com www.domain.com.au domain.com domain.com.au
>
> $number= substr_count ($domaname,".");
<snip verbose code>
Regex time (untested, so may need to be tweaked slightly):
$domaname=preg_replace("/^(www\.)?(.+)\.com(\.au)$/i","$2",$domaname);
--
CC
--
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]