Possible Duplicate:
How to parse and process HTML with PHP?
Problem:
Only extract the first < ul class="list">< /ul> from a webpage using preg_match and dump it into an array.
Code:
$str = file_get_contents('http://www.domain.com');
preg_match('#<ul class="list">(.*)</ul>#i', $str, $matches);
Desired goal:
To get the first < ul> and dump it all in an array. < ul> should be parent and every element inside should be child.