ProAnswers.org

How to parse HTML/XML in PHP?

The DOM extension allows you to operate on XML documents through the DOM API with PHP 5. It is an implementation of the W3C’s Document Object Model Core Level 3, a platform- and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure and style of documents.

You can also try

http://code.google.com/p/phpquery/

I would recommend you to use PHP Simple HTML DOM Parser

http://sourceforge.net/projects/simplehtmldom/