You are here

function _field_ipaddress_shorthand2long in IP address fields 7

1 call to _field_ipaddress_shorthand2long()
_field_ipaddress_validate_shorthand in ./field_ipaddress.module
Validate a shorthand input.

File

./field_ipaddress.module, line 363

Code

function _field_ipaddress_shorthand2long($shorthand) {
  $res = _field_ipaddress_shorthand2dottedquad($shorthand);
  if (!$res) {
    return FALSE;
  }
  list($start, $end) = $res;
  return array(
    'start' => ip2long($start),
    'end' => ip2long($end),
  );
}