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_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
how can i add the namespace name before the attribute in xml using simplexml

Categories

HOME
java
google-chrome-extension
hive
drivers
relative-path
routes
jxls
umd
onelogin
qore
virtualization
elasticsearch-hadoop
python-unittest
kibana-4
volttron
hex-editors
quartz-scheduler
lucene.net
mps
accessor
devops
dxf
tdd
su
status
user-interaction
xacml
google-cloud-nl
procdump
instant-messaging
pdb
calibre
hybridauth
wallpaper
amazon-kinesis-kpl
html5-fullscreen
wixsharp
revolution-slider
automake
libvpx
c11
az-application-insights
sqlite2
impersonation
greenrobot-eventbus
turbogears
heightmap
logfiles
jsch
appcompat
dandelion
return-value
rdfs
drupal-6
linode
imanage
django-scheduler
redundancy
mediaelement
removechild
android-textview
slicknav
ado.net-entity-data-model
dstu2-fhir
xml-attribute
paypal-express
player
qpid
react-native-listview
ready-api
master-slave
tcpserver
qtableview
marching-cubes
intellij-14
metaclass
django-unittest
fouc
ng-animate
rdtsc
markers
bitcoinj
flask-cors
seaside
kgdb
viadeo
imdbpy
prettify
ivyde
apc
opcache
sqlperformance
smtp-auth
bitsharp
dsn
armcc
labwindows
parametric-equations
heartbeat
sudzc
rtml

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App