The following PHP code example can be used to get the unique IP address for a visitor viewing a web page and display the IP address.