In php, Prepare string and create XML/RSS Feed

Posted by Bill on Stack Overflow See other posts from Stack Overflow or by Bill
Published on 2010-05-10T12:52:05Z Indexed on 2010/05/10 12:54 UTC
Read the original article Hit count: 277

Filed under:
|
|
|
|

I want to create my own RSS/XML feed. I fetch data from the database to display, but keep getting invalid character errors. If the string has an ampersand or other strange characters in it, the XML will be invalid.

I tried using urlencode and htmlentities, but these don't capture all possible characters which need to be escaped. Does anyone know of a PHP function which will prepare a string for XML output?

© Stack Overflow or respective owner

Related posts about php

Related posts about Xml