How to use inet_pton() function to convert a human readable IP address to packed in_addr in PHP

1 Answer

0 votes
$packed = inet_pton('127.0.0.1');
echo $packed . "<br />";
$s = inet_ntop($packed);
echo $s . "<br />";

   
/*
run: 


127.0.0.1

*/

 



answered May 11, 2016 by avibootz
...