no, getaddrinfo is not a PHP function. (Read the wiki entry on 'getaddrinfo')
As for getting IPv6 addresses from a hostname, you will need to look at the dns_get_record function. This is because gethostbyname will always return a IPv4 address. If you do use dns_get_record, you must pass in DNS_AAAA as the type as the second parameter to find the IPv6 address of the hostname.