[Solved] Fatal error: Call to a member function getElementsByTagName() on array
[ad_1] Obviously $songs is an array of divs. If you need just the first one, then use index: $songs[0]->getElementsByTagName(‘ul’); It would be a good idea to check if $songs array is not empty before that: if (!empty($songs)) { $songs[0]->getElementsByTagName(‘ul’); } Please note that DOMDocument::getElementsByTagName method returns DOMNodeList object which is collection-like. Thus if you want … Read more