Home > Backend Development > PHP Tutorial > 请教各位大侠php有木有host的功能

请教各位大侠php有木有host的功能

WBOY
Release: 2016-06-13 13:27:51
Original
890 people have browsed it

请问各位大侠php有木有host的功能
比如我想通过php抓取一个页面 http://www.xxx.com/test.php
但是www.xxx.com这个域名是需要在我本地做了下面这样的host才能访问的
123.1.1.1 www.xxx.com

我不想再服务器上修改/etc/hosts文件
我有什么办法可以在php里面设置域名www.xxx.com是指向IP:123.1.1.1的

------解决方案--------------------

探讨

引用:

直接访问 123.1.1.1 ip不行?

不行的,只能通过域名访问
就是php可以在代码里做host吗
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template