php get element by selector code example Example: php domdocument list all elements foreach($dom->getElementsByTagName('*') as $element ){ }