airnet
airnet

Reputation: 2673

trying to use preg_match_all to get table contents from page

I have an html page and I want to get the contents in a table. the table starts with grid tag and ends with grid tag,

My function is this:

preg_match_all("/<grid>.*<\/grid>/",$page, $matches,PREG_OFFSET_CAPTURE);

I get a null array.

Upvotes: 0

Views: 228

Answers (1)

David Fells
David Fells

Reputation: 6798

Don't use a regex, use something like QueryPath - I've used it dozens of times with great success. It works like jQuery, for PHP.

Upvotes: 2

Related Questions