1. 程式人生 > >PHP與XML

PHP與XML

mxml line test div defined reat app tex fine

代碼:

<?php
$dom= new DomDocument(‘1.0‘);
$books=$dom->appendChild($dom->createElement_x_x(‘books‘));
$book=$dom->appendChild($dom->createElement_x_x(‘book‘));
$title=$dom->appendChild($dom->createElement_x_x(‘title‘));
$title->appendChild($dom->createTextNode(‘spring‘));
$dom->formatOutput=true;
$my=$dom->saveXML();
$dom->save(‘sa.xml‘);

錯誤提示:

Fatal error: Call to undefined method DOMDocument::createElement_x_x() in D:\www\test\sa\a.php on line 3

原因:

網上查到的信息是》》domxml與DOMDocument,Fatal error: undefined method domdocument::createElement_x()2008-07-17 02:56domxml擴展已被移動到 PECL 庫中且自以下版本起不再被綁定到 PHP 中:5.0.0.

所以大概是版本問題?問題未解決

PHP與XML