INET_ATON() and INET_NTOA() in PHP?

后端 未结 6 2236
予麋鹿
予麋鹿 2020-12-02 18:59

I want to store IP addresses in my database, but I also need to use them throughout my application. I read about using INET_ATON() and INET_NTOA()

6条回答
  •  无人及你
    2020-12-02 19:07

    ip2long is equivalent to inet_aton().

    ip2long only works with IPv4. I suspect your system is using IPv6 for loopback. Try to print REMOTE_ADDR.

提交回复
热议问题