Start New Discussion within our Software Development Community

I'm trying to convert this xml to json or array.

first this is what i did:

$response = simplexml_load_string($xml_test);

and i got error: < not found,
anyone can help me?

HTTP/1.1 200 OK Date: Wed, 03 Jun 2015 10:19:38 GMT Server: Apache-Coyote/1.1 Pragma: no-cache Cache-Control: no-cache Expires: Thu, 01 Jan 1970 00:00:00 GMT Content-Type: text/xml;charset=UTF-8 Connection: close  <?xml version="1.0" encoding="UTF-8"?> <serv:message xmlns:serv="" xmlns:com="" xmlns:meet="" xmlns:att=""><serv:header>

<serv:bodyContent xsi:type="meet:createMeetingResponse" xmlns:xsi="">

If you're including the http header line as part of $xml_test, then I think that's the problem. The first characters simplexml should see should be <?xml, so as soon as it doesn't see '<' as it's first character, it kicks out an error.

This article has been dead for over six months. Start a new discussion instead.