Php xml或json HTTP请求的最快方法?

Php xml或json HTTP请求的最快方法?,php,xml,curl,file-get-contents,Php,Xml,Curl,File Get Contents,我注意到curl比file\u get\u内容快得多,还有更快的吗 $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_URL,'http://api.blah.com/xml.php'); $content = curl_exec($ch); $xml = new SimpleXMLElement($content); $file = file_get_cont

我注意到curl比file\u get\u内容快得多,还有更快的吗

$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL,'http://api.blah.com/xml.php');
$content = curl_exec($ch);
$xml = new SimpleXMLElement($content);

$file = file_get_contents('http://api.blah.com/xml.php');
$xml = new SimpleXMLElement($file);

现在有很多其他类似的问题,但是没有一个能回答主要问题,有没有一个测试更快的替代方案?没有其他人提供了这个答案,一些人提到了套接字,但没有人提供比较测试速度。

现在
文件获取内容
很快
但是
curl
更快
最快的是
curl\u multi
,因为这种方式可以一次发送数百个请求


开始。

如果curl比
file\u get\u contents
快得多,您应该检查服务器配置,因为通常情况下不会这样。