Re: accessing RAW response
| From: | tg-php at gryffyndevelopment dot com | Date: | Mon, 19 Dec 2005 16:04:15 +0000 |
| Subject: | Re: accessing RAW response | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-227654@lists.php.net to get a copy of this message | ||
There's probably a better way to do it, but I'd start parsing your respond and search for
"<?xml version="1.0" encoding="iso-8859-1"?>" and start your
data collection after you see that.
If you're using PHP's XML parser (xml_parser_create() and such), then you don't have
to worry about the header. It'll be disregarded since it's not 'contained'
inside any tags.
Cheap hack, but should work fine.
-TG
= = = Original message = = =
Hi,
I am posting a request to a server from a PHP and getting a result. When I
trap the response, it comes with all the contents. Is there a method to
strip off the extra information and just capture the result?
For example I get
HTTP/1.1 200 OK
Date: Mon, 19 Dec 2005 07:25:38 GMT
Server: Apache/2.0.55 (Win32) PHP/5.1.1
X-Powered-By: PHP/5.1.1
Content-Length: 190
Connection: close
Content-Type: text/xml
<?xml version="1.0" encoding="iso-8859-1"?>
<responseValue>blah blah</responseValue>
Is it possible to just grab the "<responseValue>blah blah</responseValue>"
directly or do I have to parse through this response to get it?
Thanks in advance.
___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.