Convert a readable IP address into a packed format:
<?php
$addr = inet_pton("127.0.1.1");
echo $addr;
?>
The inet_pton() function converts a readable IP address into a packed 32bit IPv4 or 128bit IPv6 format.
inet_pton(
address)
Parameter | Description |
---|---|
address | Required. Specifies a readable IP address |
Return Value: | The address as a packed 32bit IPv4 or 128bit IPv6 format. FALSE on failure |
---|---|
PHP Version: | 5.1+ |
PHP Changelog: | PHP 5.3: Now available on Windows platforms |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!