Create .xml file in php
I want to save this xml data in a separate .xml file in cakePHP but its not working. I used following code:
$xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
$xml.= " <registration>";
$xml.= " <id>".$a."</id>";
$xml.= " <name>".$b."</name>";
$xml.= " </registration>";
$fh = fopen('my_xmls.xml', 'w+');
what is the problem in this code or please give me a new code.
That looks fine, what's "not working" about it?
Does the actual code include the opening <?php tag?
You may want to ensure all error reporting is on, or check the PHP error log to see if there are file write permission errors or such.
I applaud you. Cheers to CakePHP!
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)