BlaBla.cn

PHP: DomNode->node_type - Manual

BlaBla.cn
DomNode->node_value > <DomNode->node_name
Last updated: Wed, 19 Mar 2008

DomNode->node_type

(No version information available, might be only in CVS)

DomNode->node_type — Returns type of node

说明

int DomNode->node_type ( void )

Returns the type of the node. All possible types are listed in the table in the introduction.

<?php

include  'example.inc' ;

$dom  domxml_open_mem ( $xmlstr );

$chapter  $dom -> document_element ();

// Let's see the elements contained in chapter
foreach( $chapter -> child_nodes () as  $node ) {
  if (
$node -> node_type () ==  XML_ELEMENT_NODE ) {
    echo 
$node -> node_name () .  "\n" ;
  }
}

?>

上例将输出:

title
para

   


DomNode->node_value > <DomNode->node_name
Last updated: Wed, 19 Mar 2008
 

 
BlaBla.cn

© 2005-2008 BlaBla.cn 版权所有