问题
I'm using PHP in my contact form to send an email to but I need the output to be emailed in XML format. How do I convert the form data to XML? I tried looking around for this but the only helpful information I could find was for ASP. Thanks!
回答1:
http://ie.php.net/manual/en/book.simplexml.php - should have you up and running in no time.
回答2:
I prefer XMLWriter, works great in my RSS parsers.
For a more detailed help, you need to be more specific in your question.
回答3:
Why do you need to send it as XML? and how does it need to be sent?
you can loop through your post variables and create xml items for each post variable.
来源:https://stackoverflow.com/questions/5097810/converting-form-data-to-xml