cvs: phpdoc /en/reference/domxml/functions DomElement-get-elements-by-tagname.xml

From: Date: Thu, 29 May 2003 15:25:41 +0000
Subject: cvs: phpdoc /en/reference/domxml/functions DomElement-get-elements-by-tagname.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969354030@lists.php.net to get a copy of this message
danguer Thu May 29 11:25:41 2003 EDT Modified files: /phpdoc/en/reference/domxml/functions DomElement-get-elements-by-tagname.xml Log: Added Information Index: phpdoc/en/reference/domxml/functions/DomElement-get-elements-by-tagname.xml diff -u phpdoc/en/reference/domxml/functions/DomElement-get-elements-by-tagname.xml:1.3 phpdoc/en/reference/domxml/functions/DomElement-get-elements-by-tagname.xml:1.4 --- phpdoc/en/reference/domxml/functions/DomElement-get-elements-by-tagname.xml:1.3 Sun Oct 6 23:08:34 2002 +++ phpdoc/en/reference/domxml/functions/DomElement-get-elements-by-tagname.xml Thu May 29 11:25:41 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- splitted from ./en/functions/domxml.xml, last change in rev 1.38 --> <refentry id='function.DomElement-get-elements-by-tagname'> <refnamediv> @@ -15,8 +15,36 @@ <methodparam><type>string</type><parameter>name</parameter></methodparam> </methodsynopsis> <para> - &warn.undocumented.func; + This function returns an array with all the elements which has <parameter>name</parameter> + as his tagname. Every element of the array is an DomElement. </para> + <para> + <example> + <title>Getting a content</title> + <programlisting role="php"> +<![CDATA[ +<?php +if(!$dom = domxml_open_mem($xmlstr)) { + echo "Error while parsing the document\n"; + exit; +} + +$root = $dom->document_element(); + +$node_array = $root->get_elements_by_tagname("element"); + +for ($i = 0; $i<count($node_array); $i++) +{ + $node = $node_array[$i]; + print ("The element[$i] is: ".$node->get_content()); +} + +?> +]]> + </programlisting> + </example> + </para> + </refsect1> </refentry>

« previous php.doc (#969354030) next »