$data = array(); $errors = array(); $source = get_contents("http://anidb.info/perl-bin/animedb.pl", "show=mylist&xuser=zaclin&xpass=******"); if (empty($source)) array_push($errors, "Could not retrieve raw source data."); preg_match_all("@class=\"title\".+aid=(\d+)\">(.+)<\/a>.+(\d+?)\s*\/\s*(\d+?).+(\d+?)\s*\/\s*\d+@Usx", $source, $m, PREG_SET_ORDER); if (!$m) array_push($errors,"Could not find matching data."); else { foreach ($m as $match) { $d = array(); $d['id'] = $match[1]; $d['name'] = $match[2]; $d['have'] = $match[3]; $d['total'] = $match[4]; $d['seen'] = $match[5]; $data[] = $d; } }