使用 PHP 如何检查 IP 地址是否存在于 IP 阻止列表范围内?

问题描述 投票:0回答:0

使用 PHP 我如何检查 IP 阻止列表范围内是否存在用户 IP 地址?

我有这个用户IP地址:

102.90.43.205

我有这样的 IP 块范围列表作为文本

102.36.176.0-102.36.179.255
102.36.228.0-102.36.231.255
102.38.56.0-102.38.59.255
102.38.192.0-102.38.255.255
102.64.6.0-102.64.6.255
102.64.7.0-102.64.7.255
102.64.48.0-102.64.55.255
102.67.0.0-102.67.31.255
102.67.32.0-102.67.47.255
102.67.168.0-102.67.171.255
102.68.70.0-102.68.70.255
102.68.104.0-102.68.107.255
102.68.108.0-102.68.111.255
102.68.126.0-102.68.126.255
102.68.140.0-102.68.140.255
102.68.168.0-102.68.171.255
102.69.144.0-102.69.147.255
102.69.240.0-102.69.243.255
102.88.0.0-102.95.255.255 // manually i can see the user ip address is in this range
102.128.192.0-102.128.255.255
102.129.36.0-102.129.39.255
102.130.0.0-102.130.7.255
102.130.52.0-102.130.55.255
102.130.99.0-102.130.99.255
102.130.103.0-102.130.103.255
102.131.36.0-102.131.39.255
102.131.64.0-102.131.127.255
102.131.128.0-102.131.255.255
102.134.16.0-102.134.23.255
102.134.112.0-102.134.115.255
php regex ip
© www.soinside.com 2019 - 2024. All rights reserved.