Search code examples
phpparsingsimple-html-dom

Finding part with simple html dom parser by two or more attributes per one element


I would like to say, that I know, that many think, that Simple HTML DOM parser is a really bad choice for HTML parser. Still I need to use it at the moment.

I read some articles where it was described how to search by two or more attributes per one element. They proposed something like that and one possibility with array filtering

foreach ( tag[attr1=value] as tag1 )
{
   foreach ( tag[attr2=value] as tag2 )
   {
      // print tag2[attr1=value,attr2=value]
   }
}

My question is about native posibility for finding part by two attributes. I didn't find it in the manual, but not everything is always in the manual.

Does anyone know is there such way or similar tag2[attr1=value,attr2=value] or tag2[attr1=value attr2=value] or etc.?


Solution

  • As I see there is no way to do that at the moment. It should be edited by author of this script or by some other developer/s willing to continue the development of this project. Don't know does the license allow it or not.