src/S3/S3Client.php
public static function isBucketDnsCompatible($bucket)
    {
        $bucketLen = strlen($bucket);

        return ($bucketLen >= 3 && $bucketLen <= 63) &&
            // Cannot look like an IP address
            !filter_var($bucket, FILTER_VALIDATE_IP) &&
            preg_match('/^[a-z0-9]([a-z0-9\-\.]*[a-z0-9])?$/', $bucket);
    }
public static function isBucketDnsCompatible($bucket)
    {
        $bucketLen = strlen($bucket);

        return ($bucketLen >= 3 && $bucketLen <= 63) &&
            // Cannot look like an IP address
            !filter_var($bucket, FILTER_VALIDATE_IP) &&
            preg_match('/^[a-z0-9]([a-z0-9\-\.]*[a-z0-9])?$/', $bucket);
    }
public static function isBucketDnsCompatible ( $ bucket ) { $ bucketLen = strlen ( $ bucket ) ; return ( $ bucketLen >= 3 && $ bucketLen <= 63 ) && // Cannot look like an IP address ! filter_var ( $ bucket , FILTER_VALIDATE_IP ) && preg_match ( '/^[a-z0-9]([a-z0-9\-\.]*[a-z0-9])?$/' , $ bucket ) ; }
Determine if a string is a valid name for a DNS compatible Amazon S3
bucket.

DNS compatible bucket names can be used as a subdomain in a URL (e.g.,
"<bucket>.s3.amazonaws.com").

@param string $bucket Bucket name to check.

@return bool
Determine if a string is a valid name for a DNS compatible Amazon S3 bucket .