public function getIp6array($ip){
      // expand - example: "2600:3c00::" ->  "2600:3c00:0000:0000:0000:0000:0000:0000"
      $hex = unpack("H*hex", inet_pton($ip));         
      $ipStr = substr(preg_replace("/([A-f0-9]{4})/", "$1:", $hex['hex']), 0, -1);
      
      $ipIntArray = array();
      $ipStrArray = explode(":", $ipStr);
      
      foreach ($ipStrArray as &$value) {
        $ipIntArray[] = hexdec($value);
      }
      
      return $ipIntArray;
    }
public function getIp6array($ip){
      // expand - example: "2600:3c00::" ->  "2600:3c00:0000:0000:0000:0000:0000:0000"
      $hex = unpack("H*hex", inet_pton($ip));         
      $ipStr = substr(preg_replace("/([A-f0-9]{4})/", "$1:", $hex['hex']), 0, -1);
      
      $ipIntArray = array();
      $ipStrArray = explode(":", $ipStr);
      
      foreach ($ipStrArray as &$value) {
        $ipIntArray[] = hexdec($value);
      }
      
      return $ipIntArray;
    }
public function getIp6array ( $ ip ) { // expand - example: "2600:3c00::" ->  "2600:3c00:0000:0000:0000:0000:0000:0000" $ hex = unpack ( "H*hex" , inet_pton ( $ ip ) ) ; $ ipStr = substr ( preg_replace ( "/([A-f0-9]{4})/" , "$1:" , $ hex [ 'hex' ] ) , 0 , - 1 ) ; $ ipIntArray = array ( ) ; $ ipStrArray = explode ( ":" , $ ipStr ) ; foreach ( $ ipStrArray as & $ value ) { $ ipIntArray [ ] = hexdec ( $ value ) ; } return $ ipIntArray ; }
Ipv6 to array

@param string $ip
@return array
Ipv6 to array