php-simple-html-dom-parser
php-simple-html-dom-parser copied to clipboard
getElementsByTagName() does not return array
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 I think it is old php versions legacy. It in no particular purpose now.