You are here: help on catching xml response « PHP Programming Language « IT news, forums, messages
help on catching xml response

Posted by shotokan99 on 06/15/07 02:15

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.com');
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $xml);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec ($ch);

// display the result
var_dump($response);
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.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация