// Check if site is preceeded by 'WWW'
    public function checkWWW() {
        $myDomain = $_SERVER['SERVER_NAME'];
        $FindWWW = 'wwww.';
        $POS = strpos($myDomain, $FindWWW);
        if ($POS === false) {
            return false;
        } else {
            return true;
        }
    }

any idea why this is not working? just trying to test if the site is www.site.com and not site.com

Try this:

public function CheckWWW($url = null)
{
        // Default to the current URL if none is given
        if (is_null($url)) {
                $url = $_SERVER['HTTP_HOST'];
        }

        return preg_match('/^www\./i', $url);
}

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software hosted for you - no
installation, no maintenance, new features automatic and free

             ** New Helpdesk demo now available **

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to