The Document Object Model specifies a convenience method for obtaining a list of elements of the same name. The getElementsByTagName method of DOMIT_Document returns this list as a PHP array.
If, for example,. we wished to get an array of our existing cd nodes, we could simply do:
$myCDNodesArray =& $cdCollection->getElementsByTagName("cd");
We could then iterate through this array of cd nodes using standard PHP array methods.
|