What alternative character can be used instead of underscores in subdomains to avoid cookie setting issues in PHP?

Using hyphens instead of underscores in subdomains can help avoid cookie setting issues in PHP. This is because some browsers treat underscores as invalid characters in domain names for cookies. By replacing underscores with hyphens, you can ensure that cookies are set and read correctly across different subdomains.

ini_set('session.cookie_domain', str_replace('_', '-', $_SERVER['HTTP_HOST']));