private function IpAddress::packIp4 in IP address fields 8
Same name and namespace in other branches
- 2.0.x src/IpAddress.php \Drupal\field_ipaddress\IpAddress::packIp4()
Strips leading zeros and converts an IPv4 to its binary representation.
File
- src/
IpAddress.php, line 259
Class
- IpAddress
- IpTools class.
Namespace
Drupal\field_ipaddressCode
private function packIp4($ip) {
return inet_pton(preg_replace('/\\b0+(?=\\d)/', '', $ip));
}