daily pastebin goal
30%
SHARE
TWEET

Untitled

a guest Sep 14th, 2018 53 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
  1. PHP XML DOM: working with a subsection of an xml document
  2. <quizzes>
  3.   <quiz>
  4.     <date>Yesterday</date>
  5.     <question>This is the day's question</question
  6.   </quiz>
  7.   <quiz>
  8.     <date>Today</date>
  9.     <question>This is the day's question</question
  10.   </quiz>
  11.   <quiz>
  12.     <date>Tomorrow</date>
  13.     <question>This is the day's question</question
  14.   </quiz>
  15. </quizzes
  16.    
  17. $xmlDoc = new DOMDocument()
  18. $xmlDoc->load($aboveXMLFile)
  19.  
  20. $subSection = $xmlDoc->getElementsByTagName("quiz")->item(0)
  21. $dateofSubSection = $subSection->getElementsByTagName("date")->item(0)->nodeValue;
  22. echo $dateofSubSection
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top