simplexml


Save formatted xml


Hi Can someone please tell me why this inst saving to my XML file? it doesn't return any errors but doesn't write to the file either? It might be silly so I apologize in advance
<?php
$pastor = $_POST["Speaker"];
$title = $_POST["Title"];
$link = $_POST["podcasturl"];
$download = $_POST["Download"];
$podcastid = $_POST["Podcastid"];
$pubdate = $_POST ["Date"];
$filename = 'podcast.xml';
$xml = simplexml_load_file($filename);
$xml->addChild('title');
$xml->addChild('pastor', $pastor);
$xml->addChild('title', $title);
function saveXMLFormatted($xml, $filename) {
$savexml = new DOMDocument('1.0');
$savexml->preserveWhiteSpace = FALSE;
$savexml->loadXML($xml->asXML());
$savexml->formatOutput = TRUE;
file_put_contents($filename, $savexml->saveXML());
}

Related Links

SimpleXml tar.gz
simplexml_load_file error in PHP 5.3
simplexml_load_file not a valid URI issue
Can't turn XML response into an simplexml object
Having trouble getting Fogbugz API response into a SimpleXML object
Upgraded to php 5.3.10 and simpleXMLelement is broken
Parsing RSS Feed with SimpleXML
php simplexml_load_file (script url) failed to open stream
PHP - SimpleXML not returning object
Having trouble processing XML with PHP SimpleXML
Simplexml How to access all element of the same node
simplexml_load_file failed to open stream Http request failed
Using XML node names with hyphens in PHP [duplicate]
SimpleXML Reading node with a hyphenated name
PHP simplexml Entities
PHP simplexml_load_string include form field data

Categories

HOME
openstack
magnific-popup
tinymce
include
cplex
octobercms
getelementsbytagname
installshield
onelogin
android-youtube-api
basic
python-unittest
floating-action-button
row
google-cloud-spanner
spring-tool-suite
alignment
commonmark
percona
dosgi
systemc
graphlab
tostring
normalizr
contextmenu
clickonce
scriptcs
orleans
tapestry
telerik-reporting
claims-based-identity
sqlcipher
tdd
cas
status
virtualdub
jaxb2
google-cloud-nl
tasklet
exuberant-ctags
pim
stacked
qwerty
withings
ssjs
node-gyp
apple-news
rainbowtable
scrollable
upstart
logparser
sage-one
yii2-extension
drupal-6
forever
imanage
titanium-android
dynamics-sl
yt-project
time-and-attendance
url-masking
login-control
skobbler-maps
bstr
storekit
holder.js
rhino-servicebus
xpath-1.0
qtableview
responsive-images
dundas
modalpopup
operator-precedence
java-metro-framework
titanium-modules
fluentautomation
wp-query
hyprlinkr
monomac
html5-notifications
jsctypes
runtime.exec
odata4j
dataservice
sqlperformance
cassini-dev
angularjs-controller
simba
chuck
uiviewanimation-curve
bigcouch
libc++
spyware
tomcat-valve
winbugs14
gdlib
google-friend-connect
routedevent
nsviewanimation
user-friendly
ubuntu-9.04
msdev

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App