I am trying to save an IPv6 address in a MySQL database. I am using inet_pton to do this. However, I have noticed that some IP's (in particular this localhost IP) are returning empty strings. Example:
$ip = inet_pton('::1'); And if a do a var_dump of $ip it shows that it's length is 16, but nothing is being returned:
var_dump($ip); // string(16) "" What is happening here?