Home  >  Article  >  Backend Development  >  php 如何取得网页原始码

php 如何取得网页原始码

WBOY
WBOYOriginal
2016-06-23 13:45:52977browse

我想用php抓取 http://ask.csdn.net/ 网页原始码,
不过我写出来後是用虚拟主机伺服器的ip来抓取的,
要怎麽使用客户端的IP来抓取?
我是个php新手,麻烦提供一下范例。


回复讨论(解决方案)

$content = file_get_contents('http://ask.csdn.net/');echo $content;

不会让你抓吧~······

<?phpecho "就不让你抓";?>

不太可能吧。flash 或 js 能解决跨域问题应该可以。

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