You are here: Re: [PHP] Error with DOMDocument->saveXML() « PHP « IT news, forums, messages
Re: [PHP] Error with DOMDocument->saveXML()

Posted by Stephen Leaf on 09/29/05 20:40

On Thursday 29 September 2005 12:26 pm, Stephen Leaf wrote:

I have figured it out!
My guess couldn't have been more _wrong_.
Here is all you need to recreate the Error.
There is only 1 value that is off.
in the DOMDocument I gave it the wrong encoding type.
uft-8 .. it should read utf-8.
Interesting that PHP doesn't tell you about a bad encoding type.

<?php
class test {
private $Dom;

function __construct ($rootName) {
$this->Dom = new DOMDocument('1.0', 'uft-8');
$this->Dom->appendChild($this->Dom->createElement($rootName));
}
function __toString() {
return $this->Dom->saveXML();
}
}

$test = new test("test");
echo $test;
?>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация