php - Convert a start and end ip range to a net mask -
good morning,
i trying subnet mask start , end ip in php.
eg; 14.1.32.0 , 14.1.64.0 255.255.224.0
but there doesn't seem built in function this? have searched refers cdir , trying ips etc seems trying go other way.
anyone have ideas?
this should want:
$ip = "14.1.32.0"; $ip2 = "14.1.64.0"; echo long2ip(ip2long($ip) - ip2long($ip2));
Comments
Post a Comment