DomDocument::get_elements_by_tagname

(PHP 4 >= 4.1.0)

DomDocument::get_elements_by_tagname Returns array with nodes with given tagname in document or empty array, if not found

Описание

array DomDocument::get_elements_by_tagname ( string $name )

See also domdocument_add_root()

[an error occurred while processing the directive]

Коментарии

Warning to win32 users: It appears that use of the wildcard argument to this function (e.g. 

<?php
  $alltags 
$domdoc->get_elements_by_tagname("*");
?>

) to return a collection of all DomElements in a document, which worked in php4.3.0-4.3.3, is broken in php4.3.4 for Windows. Upgrading broke numerous scripts depending on this behaviour, which returned to normal as soon as I rolled back to 4.3.3-win32.

I had intended to offer a workaround using child_nodes(), but found problems with this also. Therefore my suggested workarounds are either (a) don't upgrade to 4.3.4 if you're running this extension on Windows and are depending on the wildcard behaviour or (b) rewrite your code so as to use actual tagnames

The wildcard usage is per the W3C DOM spec, so hopefully this will be fixed and available again in 4.3.5.
2003-12-05 07:49:37
http://php5.kiev.ua/manual/ru/function.domdocument-get-elements-by-tagname.html

    Поддержать сайт на родительском проекте КГБ