Yesterday I was in need of detecting when a web site or page is accessed via either IPv6 or IPv4. I wrote two rather simplistic PHP functions that so far seem to be up to the job. They just look for an ocurrence of the symbol ":" in the "REMOTE_ADDR" server variable. Here they are: