if (preg_match('/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/',$_SERVER["HTTP_HOST"])) { // this is a ip address $vboptions['cookiedomain'] = "." . $_SERVER["HTTP_HOST"]; }