Hi Guys,
I am using curl to connect a 3rd party web service and I am getting the correct response.The problem is I can’t parse the response into an array and then get the string.
curl code
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, $soapUser.":".$soapPassword); // username and password - declared at the top of the doc
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_post_string); // the SOAP request
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
// converting
$response = curl_exec($ch);
the response is
<env:Envelope>
<env:Header/>
<env:Body>
<ns2:getCriteriaResponse>
<ns2:standardCriteriaWithLovs>
<adLanguages>
<language>
<label>English (UK)</label>
<value>UK</value>
</language>
</adLanguages>
</ns2:standardCriteriaWithLovs>
</ns2:getCriteriaResponse>
</env:Body>
</env:Envelope>
How can get that language code that is English (UK) and the value UK in an array.
Please help.Thanks in advance.