Source Code:
(back to article)
<?php $ip_address = "127.0.0.1"; $binary_string = inet_pton($ip_address); $hex_string = bin2hex($binary_string); echo $hex_string; // Outputs 7f000001
Result:
Report an issue