相关疑难解决方法(0)

获取网址内容PHP

我想把一个URL的内容放在一个字符串和过程中.但是,我有一个问题.

我收到此错误:

Warning: file_get_contents(http://www.findchips.com/avail?part=74ls244) [function.file-get-contents]: failed to open stream: Redirection limit reached,
Run Code Online (Sandbox Code Playgroud)

我听说这是由于页面保护和标题,cookie和东西.我怎样才能覆盖它?

我也尝试过替代品,比如fread和fopen,但我想我只是不知道该怎么做.

有人可以帮我吗?

php url curl file-get-contents

20
推荐指数
3
解决办法
13万
查看次数

php中的file_get_contents或curl?

在PHP中使用file_get_contentscurl应该使用哪个来发出HTTP请求?

如果file_get_contents能完成这项工作,是否需要使用curl?使用curl似乎需要更多的线条.

例如:

卷曲:

$ch = curl_init('http://www.website.com/myfile.php'); 
curl_setopt($ch, CURLOPT_POST, true); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $content); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
$output = curl_exec ($ch); 
curl_close ($ch); 
Run Code Online (Sandbox Code Playgroud)

的file_get_contents:

$output = file_get_contents('http://www.website.com/myfile.php'.$content); 
Run Code Online (Sandbox Code Playgroud)

php curl file-get-contents

8
推荐指数
3
解决办法
2万
查看次数

PHP:什么是最快的SOAP,file_get_contents或Curl?

我有网站A,它正在向网站B的每个页面加载发送请求.B服务器在mysql中进行一些内部搜索,需要将一些数据返回给服务器A,服务器A将根据该响应显示一些内容.

在这两台服务器之间进行通信的最快方法是什么?

curl soap file-get-contents

7
推荐指数
1
解决办法
1521
查看次数

标签 统计

curl ×3

file-get-contents ×3

php ×2

soap ×1

url ×1