PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I found this function very useful. When you have DOMDocument, you can convert the DOMObject to an array using this function. An example of usage is below:
$dom = new DOMDocument;
$dom->Load($file);
$items = $dom->getElementsByTagName('TAGNAME');
for ($i = 0; $i < $items->length; $i++) {
$policeler[$i] = dom2array($items->item($i));
}
//print_r($policeler);
// the following line will give you the value of desired TAG,
// 0 (zero) implies the first element in the document.
echo $policeler[0]["TAGNAME"]["#text"];
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]