2011-01-14 91 views
0

如何使用php curl接收xml响应?我不需要操纵XML或存储它或类似的东西。我只需要以简单的XML接收它。有谁知道如何做到这一点?如何使用php curl接收xml响应?

+1

http://php.net/manual/en/curl.examples-basic.php – deceze 2011-01-14 07:30:43

回答

2
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, 'http://www.example.com/path/to/service'); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
$store = curl_exec($ch); 

$ store contains response。

+0

什么是url,“http://www.example.com/path/to/service”应该是什么? – Michael 2011-01-14 07:44:28