note 23333 added to function.domdocument-get-elements-by-tagname

From: Date: Mon, 15 Jul 2002 19:33:37 +0000
Subject: note 23333 added to function.domdocument-get-elements-by-tagname
Groups: php.notes 
Request: Send a blank email to php-notes+get-33103@lists.php.net to get a copy of this message
Seems that this function return an object instead of an array. I've tried this : if(!$dom = domxml_open_file("g://program files/apache group/apache/htdocs/intranetcw/data/config_one.xml")) { echo "Error while parsing the document\n"; exit; } //array DomDocument->get_elements_by_tagname ( string name) $array_element = $dom->get_elements_by_tagname("IP_ORACLE_CONFIG"); if ($array_element) { echo count($array_element)." array count<br>"; for ($i=0;$i<count($array_element);$i++) { echo $array_element[$i]." array content<br>"; } } else { echo "you get nothing"; } and the result was : 1 array count Object array content Styve -- http://www.php.net/manual/en/function.domdocument-get-elements-by-tagname.php http://master.php.net/manage/user-notes.php?action=edit+23333 http://master.php.net/manage/user-notes.php?action=delete+23333 http://master.php.net/manage/user-notes.php?action=reject+23333

« previous php.notes (#33103) next »