Answer the question
In order to leave comments, you need to log in
How to get a list of networks from the IP range in php?
Please tell me a php solution to translate a range of addresses into a network with a mask.
For example:
80.75.133.0-80.75.135.127
80.75.133.0/24
80.75.134.0/24
80.75.135.0/25
Answer the question
In order to leave comments, you need to log in
Consider an example of writing a range of IP addresses in the form 10.96.0.0/11. In this case, the subnet mask will have the binary form 11111111 11100000 00000000 00000000, or the same in decimal: 255.224.0.0. 11 bits of the IP address are assigned to the network number, and the remaining 32 - 11 = 21 bits of the full address - to the local address in this network. In total, 10.96.0.0/11 means the address range from 10.96.0.1 to 10.127.255.255.
did you read this?
www.php.net/manual/en/ref.network.php#75922
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question