keyoh Posted January 26, 2008 Share Posted January 26, 2008 When I add data to my xml file it's not formatted properly, just jumbled on one line. Anyway to format it? I get this: <Show><Language>English</Language></Show> I want this: <Show> <Language>English</Language> </Show> Link to comment https://forums.phpfreaks.com/topic/87863-solved-simplexml-formatting/ Share on other sites More sharing options...
marcus Posted January 26, 2008 Share Posted January 26, 2008 <?php echo "<Show>\n"; echo "\t<language>English</language>\n"; echo "</Show>\n"; ?> <Show> <language>English</language> </Show> Link to comment https://forums.phpfreaks.com/topic/87863-solved-simplexml-formatting/#findComment-449473 Share on other sites More sharing options...
hitman6003 Posted January 26, 2008 Share Posted January 26, 2008 This may help: http://us2.php.net/manual/en/function.simplexml-element-asXML.php#77816 Link to comment https://forums.phpfreaks.com/topic/87863-solved-simplexml-formatting/#findComment-449485 Share on other sites More sharing options...
keyoh Posted January 26, 2008 Author Share Posted January 26, 2008 Yeah that is really close to what I need, but I'm not sure how I can use it like this: $xmlnew->asPrettyXML($series_xml); Link to comment https://forums.phpfreaks.com/topic/87863-solved-simplexml-formatting/#findComment-449891 Share on other sites More sharing options...
keyoh Posted January 26, 2008 Author Share Posted January 26, 2008 Alright, I just modified the pretty asxml to get it working. Thank you. Link to comment https://forums.phpfreaks.com/topic/87863-solved-simplexml-formatting/#findComment-449965 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.