I need to convert a ipv6 address to its nibble format for use in creating ptr records dynamically. Here is the information I got from Wikipedia:
IPv6 reverse resolution
Reverse DNS lookups for IPv6 addresses use the special domain ip6.arpa. An IPv6 address appears as a name in this domain as a sequence of nibbles in reverse order, represented as hexadecimal digits as subdomains. For example, the pointer domain name corresponding to the IPv6 address 2001:db8::567:89ab is b.a.9.8.7.6.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa.
The only thing I could find regarding nibbles was in the pack function, http://www.php.net/pack. I could not find any solutions with examples from googling the issue.
Any help is greatly appreciated.