I tried to output XML in the view file. The view file is result_view.php
and its first line is
<?php echo '<?xml version="1.0" encoding="UTF-8"?>'; ?>
But I get the error "Content is not allowed in prolog". So how to do this correctly? I use Eclipse + PDT.
One easy solution is to set php header in the view file and then echo the xml header.
Put this in the top of your view file:
<?php header ("Content-Type:text/xml"); ?>
<?php echo '<?xml version="1.0" encoding="UTF-8"?>';?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With