note 23333 deleted from function.domdocument-get-elements-by-tagname by sobak

From: Date: Tue, 22 Nov 2016 03:39:42 +0000
Subject: note 23333 deleted from function.domdocument-get-elements-by-tagname by sobak
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-207387@lists.php.net to get a copy of this message
Note Submitter: scouture at courtweb dot com ---- 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

« previous php.notes (#207387) next »