Re: Generating proper XML with PHP



On 2005-07-27, Ken <2jghb3a02@xxxxxxxxxxxxxx> wrote:
> I wrote a simple php script that generates an XML file based on a DB
> query. The problem is that some of the db entries may contain tabs,
> gt/lt signs, and other XML-unfriendly characters.
>
> Is there a stock function for replacing these with their proper XML
> escape sequences? I suppose I could do it with regex, but it seems this
> would be so common that it's silly to write it over again.


As already mentionned, htmlentities and the like can do a lot..
Or you could use XML it's <![CDATA[ ]]>


--
Met vriendelijke groeten,
Tim Van Wassenhove <http://timvw.madoka.be>
.