/ Published in: PHP

A simple code to read/write an XML file by using Cakephp 1.3.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//Save data to an xml App::import('Helper', 'Xml'); App::import('Core','File'); $xml = new XmlHelper(); $xmlFile->write($file, 'w'); $xmlFile->close(); //Read data from an XML App::import('Helper', 'Xml'); $parsed_xml = new XML(path_to_file); $data = $parsed_xml->toArray(); $this->data['Email'] = $data['StdClass']; }
Comments
