I need to do a looping program for my website. A basic PHP code to generate XML. I am new to this, and not sure if I need help with MySQL or not.
Please Help or PM me. Would love to talk to someone on the phone about it.
Thanks,
Don
| SitePoint Sponsor |
I need to do a looping program for my website. A basic PHP code to generate XML. I am new to this, and not sure if I need help with MySQL or not.
Please Help or PM me. Would love to talk to someone on the phone about it.
Thanks,
Don
While, do-while, for, foreach
All about loops in PHP
Guido - Community Team Advisor
Do you know where the (database) error is? Add it to the list!
Thinking Web: Voices of the Community
Blog - Free Flash Slideshow Widget





Building XML is easy, you're just constructing a string.
Be familiar with how to concatenate strings, and read the functions guido linked you to. Then just use file_put_contents to write the string as an XML file.
PHP Code:$xml = "<?xml .....";
foreach($myArray as $el) {
$xml.= "...append elements here....";
}
//Write to file
file_put_contents('myxmlfile.xml', $xml);


XML is not a string. XML is a node tree. Use the proper functions to create XML as an object, or risk dealing with fun character encoding issues.
Guido - Community Team Advisor
Do you know where the (database) error is? Add it to the list!
Thinking Web: Voices of the Community
Blog - Free Flash Slideshow Widget
lol, sorry, new today, just seeing how the forums work lol. so doing a bit of 'hmm' ing and 'arrhhh' ing and 'ah ha' ing. trying to find where IM is.
Okay, I read what you suggested, but I still need help. Is there anyone who can help me?
PM Me Please so we can talk.
I appreciate it, thanks.
Don
Bookmarks