Jump to content

PHP DOM


TheJoey

Recommended Posts

<?php
$xmlDoc = new DOMDocument();
$xmlDoc->load("abc.xml");


// We need to validate our document before refering to the id
$xmldoc->validateOnParse = true;

function $id
{


}

$xmldoc->getElementById('$id')->tagName . "\n";





print $xmlDoc->saveXML();
?> 

 

<books>
<book>
<author>Jack Herrington</author>
<title>PHP Hacks</title>
<publisher>O'Reilly</publisher>
</book>
</books> 

 

im new to this sort of this but what im trying to do is

make $id user inputted so if they wanted title it would file title from this file, im not sure how to go about writing a function for that

Link to comment
https://forums.phpfreaks.com/topic/201499-php-dom/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.