help on catching xml response

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

    help on catching xml response

    i really dont know how to ask it right, but i have this code:
    //-----------------//
    $xml= '<xml ..
    ..
    ..
    ..
    <enddoc>';

    $ch = curl_init();
    curl_setopt($ch , CURLOPT_URL, 'http://mydestination.c om');
    curl_setopt ($ch, CURLOPT_POST, 1);
    curl_setopt ($ch, CURLOPT_POSTFIE LDS, $xml);
    curl_setopt ($ch, CURLOPT_RETURNT RANSFER, 1);
    $response = curl_exec ($ch);

    // display the result
    var_dump($respo nse);
    curl_close ($ch);
    //---------------------//

    this code is working well. upon running the code it will give an xml
    reply, however on the page it looks somethng like this:

    string(426) " xxxx.... .. Email already exist, 1 "

    on the page if your going to right click and view source, you will see
    a well structured xml:

    string(426) "<?xml version="1.0" encoding="UTF-8"?>
    <myxml>
    ..
    ..
    ..
    </myxml>"

    my issue is how to get the value of one of the element from this xml?
    next, i want the response not to be displayed right away on the page
    as raw string..i need to trap it and display that on a more fine
    manner. how to do this? any help would be highly appreciated.

  • shotokan99

    #2
    Re: help on catching xml response

    just wanted to add...

    what i wanted to do next is get the value between a certain element on
    that response xml and assign it to my php variable $mypin.

    tnx

    Comment

    Working...