Navigation

Search

range2ip

Description

Converts a given array of ip numbers to a single string.

Syntax

string range2ip (array $low, array $high)



Parameter $low

Expected type: Array of Integers
Description: The parts of the IP address for the low end of the range



Parameter $high

Expected type: Array of Integers
Description: The parts of the IP for the high end of the range (can include '*' for wildcards)



Return value

Expected type: String
Description: Returns an empty string if either array has less than 4 items, 'unknown' for 255.255.255.255 or the IP range (1.2.3.4-5 for example)


Notes

  • Internal function used to convert a format suitable for the database to a user-readable format.
  • Range2ip(array(10, 10, 10, 0), array(10, 10, 20, 255)) returns '10.10.10-20.*
  • Returns 'unknown' if the ip in the input was '255.255.255.255'.
  • Reverse of 'ip2range' function
  • Located in ManageMembers.php in 1.0.x
View all versions of this function