note 81019 added to function.dom-domdocument-getelementsbytagname
| From: | jason at shaped dot ca | Date: | Mon, 11 Feb 2008 12:59:47 +0000 |
| Subject: | note 81019 added to function.dom-domdocument-getelementsbytagname | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-136036@lists.php.net to get a copy of this message | ||
in response to tildy at pr dot hu
my preferred way is (in example to gather country data from an iso 3166 xml flie)
$countries = new DOMDocument();
$countries->load("./lib/iso_3166.xml");
$countriesList = $countries->getElementsByTagName("ISO_3166-1_Entry");
foreach($countriesList as $country) {
$values = $country->getElementsByTagName("*");
foreach($values as $node) {
echo $node->nodeName."=".$node->nodeValue;
}
}
----
Server IP: 216.235.15.211
Probable Submitter: 68.145.58.126
----
Manual Page -- http://www.php.net/manual/en/function.dom-domdocument-getelementsbytagname.php
Edit -- https://master.php.net/note/edit/81019
Del: integrated -- https://master.php.net/note/delete/81019/integrated
Del: useless -- https://master.php.net/note/delete/81019/useless
Del: bad code -- https://master.php.net/note/delete/81019/bad+code
Del: spam -- https://master.php.net/note/delete/81019/spam
Del: non-english -- https://master.php.net/note/delete/81019/non-english
Del: in docs -- https://master.php.net/note/delete/81019/in+docs
Del: other reasons-- https://master.php.net/note/delete/81019
Reject -- https://master.php.net/note/reject/81019
Search -- https://master.php.net/manage/user-notes.php