Possible Duplicate:
Getting SimpleXMLElement to include the encoding in output
PHP :
$xml = new SimpleXMLElement("<Title0></Title0>");
$xml->Title1='Some Text 1';
$output = $xml->asXML('mak.xml');
XML Output :
<?xml version="1.0"?>
<Title0>
<Title1>Some Text 1</Title1>
</Title0>
But I want to add attrbute like encoding="utf-8"
to xml header , so that I can have something like this :
<?xml version="1.0" encoding="utf-8" ?>
<Title0>
<Title1>Some Text 1</Title1>
</Title0>
I dont want to use find and replace sort of things on the output file.