One method of scraping information from HTML is by using regular expressions, e.g.:
$pattern = '/<img [^>]*src=["\']image1.jpg["\'][^>]*>([^>]+)<img [^>]*src=["\']football.jpg["\']/i';
preg_match_all($pattern, $data, $matches);
where the above code would yield an array of $matches[1] like so:
[pre] [1] => Array
(
[0] => Name Number 1
[1] => Name Number 2
[2] => Name Number 4
[3] => Name Number 5
[4] => Name Number 8
)[/pre]
Benefits are that it's simple (provided you know regular expression syntax, of course :p) and compact - one function and the data is extracted. Drawbacks are that it's simple and compact. 🙂 It's nothing more than flexible pattern matching; if the pattern is changed very much, then the regexp pattern can be broken and will need to be updated.
Another approach is to use [man]DOM[/man] to actually parse the HTML document and traverse its structure. This does have the benefit of sometimes being more flexible than regexp (although it still requires you to know something about the structure of the data that you're looking for), but it takes a little more code.