I can calculate cidr from subnet mask for ipv4 using "ip2long" php method. How should i calculate the same for ipv6?
For example,
I can calculate the following:
255.255.252.0 => /22
How should i calculate the same for ipv6 addresses like:
ffff:ffff:ffff:ffff::
ffff:ffff:ffff:ffff:0:0:0:0
When i tried the same for ipv6 i didn't get any output?
Note: I am not calculating the ip addresses using this CIDR notation. I just want to convert the subnet mask of ipv6 to its related networking bits.