php-simple-html-dom-parser icon indicating copy to clipboard operation
php-simple-html-dom-parser copied to clipboard

getElementsByTagName() does not return array

Open MaximMoinat opened this issue 8 years ago • 1 comments

If you try to get all the anchors like this, then by default one (the last) element is returned: $anchors = $soup->getElementsByTagName('a'); The following does give me all the elements: $anchors = $soup->getElementsByTagName('a', null);

The idx value defaults to -1. Is this on purpose?

MaximMoinat avatar Dec 27 '16 22:12 MaximMoinat

@MaximMoinat I think it is old php versions legacy. It in no particular purpose now.

sunra avatar Dec 28 '16 22:12 sunra