Tag Archives | CIDR notation
PHP: Convert IP Range to CIDR

PHP: Convert IP Range to CIDR

Read first: PHP: Convert CIDR to ipaddress range PHP: check valid ipaddress or CIDR notation range This function work done with small IP range ex: 111.234.23.1 – 11.234.23.243 Solution 1 Example of usage: result: Array ( [0] => 121.0.47.0/32 [1] => 121.0.47.1/31 [2] => 121.0.47.3/30 [3] => 121.0.47.7/29 [4] => 121.0.47.15/28 [5] => 121.0.47.31/26 [6] […]

Read full story Comments { 1 }
PHP: check valid ipaddress or CIDR notation range

PHP: check valid ipaddress or CIDR notation range

This function checks for a valid IP address or CIDR notation address range. Example of usage:

Read full story Comments { 0 }
PHP: Convert CIDR to ipaddress range

PHP: Convert CIDR to ipaddress range

This function takes an IP address and CIDR netmask (e.g. 102.68.1.0/25), and calculate IP address range in that netblock. Example: result: array(2) { [0]=> string(10) “102.68.1.0” [1]=> string(12) “102.68.1.127” }

Read full story Comments { 0 }