[eluser]kenny.katzgrau[/eluser]
Hey guys, awesome framework.
I was making a view file which was essentially a template for an RSS feed.
At the top of the feed template, I had:
Code:
<?xml version="1.0" encoding="utf-8"?>
I found that my server was interpreting the <? ?> in the xml declaration was being picked up by the PHP interpreter, so instead, I wrote:
Code:
<?php echo '<?xml version="1.0" encoding="utf-8"?>'; ?>
But I got parsing errors from my RSS reader because a mysterious semicolon was being placed before all closing ?>, even though it was in the closed string being echo'd.
The put it plainly,
Code:
<?php echo '<?xml version="1.0" encoding="utf-8"?>'; ?>
is produced as:
Code:
<?xml version="1.0" encoding="utf-8"; ?>
Which I think might be a result of CodeIgniter trying to add semi-colons to unterminated statements. I do have the <?= shorttags enabled.
My final solution, although pretty hacky, was to use:
Code:
<?php echo '<' . '?xml version="1.0" encoding="utf-8"?' . '>'; ?>