Home >Backend Development >PHP Tutorial >如何用php获取指定网站的ip,比如获取baidu.com的ip呢?

如何用php获取指定网站的ip,比如获取baidu.com的ip呢?

WBOY
WBOYOriginal
2016-06-06 20:29:121346browse

这个使用php本身可以实现吗?

回复内容:

这个使用php本身可以实现吗?

echo gethostbyname ( 'www.baidu.com' );//180.97.33.108

用php执行系统自带的解析域名的命令

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn