it says<?xml version="1.0"?>
What is that?Resource id #3"1.0"?>
here's the php I'm using:
Code: Select all
<?php
$raw_xml = file_get_contents('php://input');
//ignore the document type
$raw_xml = preg_replace("/\<\?xml.*?\>/", '', $raw_xml);
$raw_xml = trim($raw_xml);
//open the file for reading and writing
$fp = fopen("Stories.xml", "r+b");
//add new story
$storiesFileNew = preg_replace("</stories>", "$raw_xml </stories>", $fp);
//write to file
fwrite($fp, $storiesFileNew);
fclose($fp);
//send to flash
print $raw_xml;
?>Code: Select all
<?php
$fp = fopen("Stories.xml", "r+b");
?>