How to get CURLs reponse in Array
Posted
by sushil
on Stack Overflow
See other posts from Stack Overflow
or by sushil
Published on 2010-06-12T08:09:47Z
Indexed on
2010/06/12
8:12 UTC
Read the original article
Hit count: 340
Hello friends.
I have one problem regarding CURL. I am trying send CURL request to http://whatismyipaddress.com
so.. is there any way to get curl response in array ? because right now it display the HTML Page but i want the response in array.
here is my code...
$ipAdd = '121.101.152.170';
$ch = curl_init("http://whatismyipaddress.com/ip/".$ipAdd);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);
curl_setopt($ch, CURLOPT_HEADER,0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
echo $output;
So.. currently i am getting the detail HTML page but i want the out put as array or XML.
© Stack Overflow or respective owner