Join the Stack Overflow Community
Stack Overflow is a community of 6.3 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

I have obtained such a response after executing one curl request.

<?xml version="1.0" encoding="utf-8"?>
<mp_response>
<response_element>
<merchantid>
36573dkjdkjds3987398
</merchantid>
<orderid>
1
</orderid>
<responsecode>
23
</responsecode>
<description>
Transaction Payout Completed
</description>
</response_element>
</mp_response>

But when I use functions like

new SimpleXMLElement($xml_str);
simplexml_load_string($data)

etc. I get an error like

Start tag expected, '&lt;' not found

What should I do?

share|improve this question
    
can you post the code how you read the data out of curl, it sounds like your string is urlencoded – DevZer0 Jun 13 '13 at 9:37
    
Looks like your $xml_str or $data does not contain any XML. – MrCode Jun 13 '13 at 9:39

After closing curl use "simplexml_load_string($string)"
$string is a variable which stores curl_exec();
Then take a variable for retrieving data from the xml.
e.g.,

$data=simple_load_string($string);
$response=$data->response_element->merchantid;
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.