PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  
<DomNode->node_nameDomNode->node_value>
Last updated: Mon, 16 Jul 2012

DomNode->node_type

(no version information, 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.

例子 1.

<?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_nameDomNode->node_value>
 Last updated: Mon, 16 Jul 2012
 
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://manual.phpv.net/
Last updated: Thu Jul 7 19:13:47 2005 CST