Hi guy Nowdays i am developing web site and i use to save data in XMl file.I use PHP also .So i dont know how to save PHP variables data in XML file.pls help me Thank you.
Have a look at this page, and user comments below. There are some functions that will probably help. (Assuming you have PHP 5+) http://www.php.net/simplexml
hi guys According to below PHP coding it's save data into name property of movie.The Problem is i need to save it has permanent data.But in here it,s not working pls help <?php $xmlstr = <<<XML <?xml version='1.0' standalone='yes'?> <movies> <movie> <title>PHP: Behind the Parser</title> <characters> <character> <name>Ms. Coder</name> <actor>Onlivia Actora</actor> </character> <character> <name>Mr. Coder</name> <actor>El ActÓr</actor> </character> </characters> <plot> So, this language. It's like, a programming language. Or is it a scripting language? All is revealed in this thrilling horror spoof of a documentary. </plot> <rating type="thumbs">7</rating> <rating type="stars">5</rating> </movie> </movies> XML; ?> Code (markup): <?php include('XML.php'); $xml = new SimpleXMLElement($xmlstr); $xml->movie[0]->characters->character[0]->name = 'Miss Coder'; echo $xml->asXML(); ?> Code (markup):