0

Possible Duplicates:
Robust, Mature HTML Parser for PHP
Best methods to parse HTML

Hello,

What is the faster and easy HTML parser for PHP 5?

Thank you

Community
  • 1
  • 1

1 Answers1

1

if its valid xhtml, you can do this with the SimpleXML built-in library afaik

but as people mentioned, why would you want to parse it? Are you sure you dont want to search for stuff instead?

Jan Dragsbaek
  • 8,078
  • 2
  • 26
  • 46
  • yup, xhtml is valid xml and is parseable by an xml library. – Femaref Feb 13 '11 at 22:46
  • 2
    uh? HTML parsing is a perfectly valid task. And if you mean searching with XPath, then the HTML has to be parsed before too... – Felix Kling Feb 13 '11 at 22:48
  • i was thinking about regex searches, like scanning for links :) – Jan Dragsbaek Feb 13 '11 at 22:49
  • @Femaref: Good luck finding valid XHTML to parse though. It has been said for years that unless you *totally* control the content (i.e., no user-supplied comments or anything like that) and are willing to be anal about XML validity, XHTML is not a practical option. – Jon Feb 13 '11 at 22:50