title: Php convert ipv6 to number
body: <p>In Ipv4 we can use <code>ip2long</code> to convert it to number,</p>
  
  <p>How to convert ipv6 compressed to number in PHP?</p>
  
  <p>I tried inet_pton and it's not working.</p>
  
  <pre><code>$ip_1='2001:0db8:85a3:0000:0000:8a2e:0370:7334'; 
  $ip_2='2001:11ff:ffff:f';//Compressed
  echo inet_pton($ip_1); 
  //OUTPUT  ИЃ.ps4
  echo inet_pton($ip_2);
  //OUTPUT Warning: inet_pton(): Unrecognized address 2001:11ff:ffff:f
  </code></pre>