DomDocument :Call to undefined method domdocument::createElement()

Please does anyone no why I would be getting this when running version 5 of php?

faultCode1faultStringWarning:domdocument::domdocument() expects at least 1 parameter, 0 given in C:\Apache\htdocs\ajax\foundations\phptest.php on line 5faultCode1faultStringFatal error:Call to undefined method domdocument::createElement() in C:\Apache\htdocs\ajax\foundations\phptest.php on line
//set the conte type as xml
header ('content type: text/xml');
// create new XML document
$dom = new DOMDocument();

// create the root <response> element

//create the <boooks> element and append it as a child of response

//create the title element for the book
$titletext=$dom->createTextNode('Builing responsive web applications with PHP and AJAX');

//create isbn element

//create the book element
//append book as a child of books
//build the xml structure is a string variable
//output the xml string
echo $xmlString;


Open in new window

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Or use
$dom = new DOMDocument('1.0', 'UTF-8');


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.