#!/usr/bin/php /ms','',$data); # cut data after table $data = preg_replace('/<\/tbody>.*$/ms','',$data); # split in to rows preg_match_all('/.*?([^<>]+)<\/a><\/td>.*?([^<>]+)<\/a><\/td>.*?<\/tr>/s',$data,$matches); # remove whole-row capture array_shift($matches); # display results for($i=0;$i