例如,我有我的的.htaccess文件這些指令: <Limit GET HEAD POST>
order deny,allow
allow from 1.37.0.0/16
allow from 23.226.128.240/31
allow from 23.234.68.64/27
allow from 23.234.80.200/29
allow from 23.234.91.16
我無法在沒有多個if語句的情況下執行此操作。 僞代碼: ips = [...a list of around 1000 IPs]
cidr_list = ['192.168.10.0/24', '10.10.10.0/24', '192.168.3.0/24']
for ip in ips:
if ip in cidr_list: print ip
人知道正確的方式來做到這一點