Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PHP XML DOM: working with a subsection of an xml document
- <quizzes>
- <quiz>
- <date>Yesterday</date>
- <question>This is the day's question</question
- </quiz>
- <quiz>
- <date>Today</date>
- <question>This is the day's question</question
- </quiz>
- <quiz>
- <date>Tomorrow</date>
- <question>This is the day's question</question
- </quiz>
- </quizzes
- $xmlDoc = new DOMDocument()
- $xmlDoc->load($aboveXMLFile)
- $subSection = $xmlDoc->getElementsByTagName("quiz")->item(0)
- $dateofSubSection = $subSection->getElementsByTagName("date")->item(0)->nodeValue;
- echo $dateofSubSection
Add Comment
Please, Sign In to add comment