Matching IPv6 address to a CIDR subnet

前端 未结 7 2240
长情又很酷
长情又很酷 2020-12-15 12:24

Is there a good way to match an IPv6 address to an IPv6 subnet using CIDR notation? What I am looking for is the IPv6 equivalent to this: Matching an IP to a CIDR mask in PH

7条回答
  •  余生分开走
    2020-12-15 13:10

    Basically http://www.phpclasses.org/browse/file/70429.html

    To use it, simply call

    $cidr = new CIDR();
    $cidr->match($ipv6, $ipv6_in_cidr);
    

    Result is 'Good'.

提交回复
热议问题