Here is my xml:
<news_item>
<title>TITLE</title>
<content>COTENT.</content>
<date>DATE</date>
<news_item>
I want to get tag names inside news_item.
Here is what I still have:
$dom = new DOMDocument();
$dom->load($file_name);
$results = $dom->getElementsByTagName('news_item');
WITHOUT USING other php libraries like simpleXML , can I get the name of all tag names (not values) of tags for children?
Sample solution
title, content, date
I don't know the tag names inside news_item, only the tag name of the container is 'news_item'
Thanks guys!
Phil source
share