Forum Moderators: coopster

Message Too Old, No Replies

escape the xml?> characters

         

jackvull

5:08 pm on Jan 26, 2007 (gmt 0)

10+ Year Member



This seems to cause a problem as PHP takes the?> to be the end of PHP script. I then get a load of PHP in my XML file that was created. Anyway to escape it?

<?php

include("DBConnection.php");

// open a file pointer to an RSS file
$fp = fopen ("rss.xml", "w");

// Now write the header information
fwrite ($fp, "<?xml version='1.0'?><rss version='2.0'><channel>”);

coopster

5:13 pm on Jan 26, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Escape them. Example in this thread ...

[webmasterworld.com...]