Welcome to WebmasterWorld Guest from 54.159.50.111

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

php domDocument check node exists

checking for a node to exist in an xml file using php

     
10:22 am on Nov 28, 2008 (gmt 0)

New User

5+ Year Member

joined:Nov 11, 2008
posts:12
votes: 0


Hello,

This is my first time posting a problem. I would like to check if an element exists in an xml file through php. Does anyone know how to go around this?

8:41 am on Nov 29, 2008 (gmt 0)

Senior Member from MY 

WebmasterWorld Senior Member vincevincevince is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Apr 1, 2003
posts:4847
votes: 0


By ID you can do:
DomDocument->get_element_by_id ( string $id )

When it succeeds, then the node exists.