Im trying to make a xml document with PHP.
But when I try to do that I get the following error:
This page contains the following errors:
error on line 1 at column 1: Document is empty
Below is a rendering of the page up to the first error.
My source:
<?php
header('Content-Type: text/xml');
print(htmlentities('<?xml version="1.0" encoding="UTF-8"?>
<bbcodes>
<block>
<pattern><![CDATA[<p.*?>]]></pattern>
<replace><![CDATA[[p]]]></replace>
</block>
<block>
<pattern><![CDATA[</p>]]></pattern>
<replace><![CDATA[[/p]]]></replace>
</block>
</bbcodes>'));
?>
Any ideas?
I get the same error with your code. When I remove the htmlentities function, it works just fine.