php - how to get server ip4 *and* ip6 using php
问题描述
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.
- Why does it return my ip6 address? My server does have two addresses: ip4 AND ip6?
- Can I force getting ip6 / ip4?
解决方案
推荐阅读
- vb.net - 在 My.Settings 中将特定值重置为默认值
- java - 将对象列表转换为 json 数组以休息模板
- python - 从维基百科页面解析 OpenURL 数据
- android - 在另一个类中使用另一个类的数组时出现越界异常
- reactjs - 所有 SVG 大小相同
- html - 如何将背景上的渐变效果标记为重要?
- css - CSS如何在输入框的末尾有一个图像
- javascript - 在 Safari 中从 https://example.com 向 http://127.0.0.1:8766/test/ 发送请求
- javascript - Reactjs Javascript if/else 无法正常工作
- bash - Bash:根据文件名排序文件