1

I want to retrieve ip4 and ip6 address of my server in a php script. Actually I use $_SERVER['SERVER_ADDR'] - this returns my ip6 address.

  1. Why does it return my ip6 address? My server does have two addresses: ip4 AND ip6?
  2. Can I force getting ip6 / ip4?
DF8OE
  • 31
  • 3
  • 2
    Does this answer your question? [How can I get both IPv4 and IPv6 address using PHP code?](https://stackoverflow.com/questions/51245053/how-can-i-get-both-ipv4-and-ipv6-address-using-php-code) If you use the search, you will find many more [duplicate questions](https://stackoverflow.com/search?q=php+ipv4+ipv6) that may be useful. – Markus AO Aug 23 '20 at 16:25
  • Yes, question answered. Thank you for your contribution! – DF8OE Aug 23 '20 at 17:17

0 Answers0