echo xml in php and can used to decode in php -


i have script :

<?php $url = 'http://www.example.com'; $post = 'response=xml'; $ch = curl_init(); curl_setopt($ch, curlopt_post ,1); curl_setopt ($ch, curlopt_postfields, $post); curl_setopt($ch, curlopt_url, $url) curl_setopt($ch, curlopt_returntransfer,1); $result=curl_exec ($ch); echo $result; ?> 

but show :

<?xml version="1.0" encoding="utf-8"?> <interface-response> <test>this test</test><done>true</done> <requestdatetime>1/16/2016 7:50:01 am</requestdatetime> <debug><![cdata[]]></debug> </interface-response> 

it's text , can't used,i want echo this

it this want this

add below line first statement in php script. solves it

header('content-type: application/xml'); 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -