|
Posted by shotokan99 on 06/15/07 02:15
i really dont know how to ask it right, but i have this code:
//-----------------//
$xml= '<xml ..
..
..
..
<enddoc>';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://mydestination.com');
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $xml);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec ($ch);
// display the result
var_dump($response);
curl_close ($ch);
//---------------------//
this code is working well. upon running the code it will give an xml
reply, however on the page it looks somethng like this:
string(426) " xxxx.... .. Email already exist, 1 "
on the page if your going to right click and view source, you will see
a well structured xml:
string(426) "<?xml version="1.0" encoding="UTF-8"?>
<myxml>
..
..
..
</myxml>"
my issue is how to get the value of one of the element from this xml?
next, i want the response not to be displayed right away on the page
as raw string..i need to trap it and display that on a more fine
manner. how to do this? any help would be highly appreciated.
[Back to original message]
|