- mysql> select inet_aton(‘192.168.0.1‘);
- +--------------------------+
- | inet_aton(‘192.168.0.1‘) |
- +--------------------------+
- | 3232235521 |
- +--------------------------+
- 1 row in set (0.00 sec)
- mysql> select inet_ntoa(3232235521);
- +-----------------------+
- | inet_ntoa(3232235521) |
- +-----------------------+
- | 192.168.0.1 |
- +-----------------------+
- 1 row in set (0.00 sec)
- 基于php中的ip2Long和long2Ip实现
时间: 2024-10-06 13:48:03