pls help...parsing xml

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • shotokan99

    pls help...parsing xml

    i have this situation:

    i was given a query string : http://mywebservice.co m?url=<xurl>
    where
    xurl=is a valid url. now what the query string does it will display
    an
    xml on the page. like this one:


    <?xml version="1.0" encoding="UTF-8" ?>
    <response...>
    ..
    ..
    ..
    </response>

    now i made a script that looks like this:
    $xmyurl='http://myurl.com?xxxx= xxxx;
    $ch=curl_init() ;
    curl_setopt($ch ,CURLOPT_URL,$x myurl);
    curl_setopt($ch , CURLOPT_RETURNT RANSFER,1);
    $xresult=curl_e xec($ch);
    curl_close($ch) ;

    $xml = new SimpleXMLElemen t($xresult);
    echo $xml->url[0]->localUrl;

    when i tried to run, nothing is being displayed...wha t could have gone
    wrong?

Working...