extracting CDATA php4 please help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
evin1207
Forum Newbie
Posts: 6
Joined: Mon May 12, 2008 9:14 am

extracting CDATA php4 please help

Post by evin1207 »

This script reads messages in the body of a Raw post message

I need to be able to get certain feild from the xml that is created but cannot get any methods to work

i would like to get the cdata that is in the created xml file into another file or just extract the cdata from the original post message into the file that is created

:banghead:

Code: Select all

 
<?php
$putdata = fopen( "php://input" , "rb" );
$dest_xml='/var/www/webupload/scribe'.date("H:i:s").".xml";
$file = fopen($dest_xml, "a", 0);
while(!feof( $putdata )) {
fputs($file, urldecode(fread($putdata, 4096)));
fputs($file, "\n");
}
fclose($putdata);
fclose($file);
?>
 

this is my output

Code: Select all

 
response=<response><external-xml></external-xml><external-id>789456123</external-id><audio-duration>15</audio-duration><trans-xml><message><![CDATA[This is a test.  Test 1-2.  Test 1-2-3.  1-2-3-4-5-6-7-8-9-10.  (??) Communications.]]></message><result>transcribed</result></trans-xml><metadata/><truncated>false</truncated><error-code>0</error-code><ss-id>251262895</ss-id></response>

any help would be appreciated thanks
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

Re: extracting CDATA php4 please help

Post by kendall »

Post Reply