using php to check if xml is atom or rss
- by guest86
i'm writing a php code which has to determine if given xml is in "atom" or "rss" format. After observing atom and rss xml files, i decided classify xml based on a root element. If root element is "<feed" it's an atom xml. If it's "<rss" it's not an atom.
How can i perform that check using DOM? So far i have:
$dom->loadXML($resp);
$feed = $dom->getElementsByTagName("feed");
but it's not working quite right....