foreachについての質問はマスターに答えてください
XMLがあります。例:
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> <?xml version="1.0" encoding="utf-8"?> <top> <middle> <bottom> <value1>8000</value1> <value2>8001</value2> <value3>8002</value3> </bottom> </middle> </top>
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> $mid=$xml2->getElementsByTagName("middle")->item(0); foreach($mid->childNodes as $v1){ echo $v1->tagName; foreach($v1->childNodes as $c2){ echo $c2->tagName; echo $c2->nodeValue; } }