Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
gethostbyname() 和 gethostbynamel() PHP 函数有什么区别?因为两者都返回一个域名的记录。还有哪一个表现更好?
根据文档 gethostbynamel返回特定主机名的已解析 IP 地址的完整列表。其中gethostbyname只返回一个。
gethostbynamel
gethostbyname
举个例子gethostbynamel('www.google.com');,这样你就会看到一个返回的列表。
gethostbynamel('www.google.com');