([^`]*?)<\/tr>/", $data, $m); // begin table echo '
'; echo ''; $counter = 0; // parse through each row found foreach ($m[0] as $matches) { // find game id preg_match("/'; } echo '
IDDateTeamATSTotals
...<\/td>/", $matches, $temp); $id = strip_tags($temp[0]); if (!$id == "") { $counter++; } // find game dates if (($id%2) == 0) { $gameday = $oldgameday; } else { preg_match("/... .\/.*?<\/td>/", $matches, $temp); $gameday = strip_tags($temp[0]); $oldgameday = $gameday; } // find team names preg_match("/San Francisco 49ers<\/td>/", $matches, $temp); if ($temp[0] == NULL) { preg_match("/([^\d])*?<\/td>/", $matches, $temp); $team = strip_tags($temp[0]); } else { $team = "San Francisco 49ers"; } // find spreads preg_match("/[-\+].*? /", $matches, $temp); if ($temp[0] != NULL) { $spread = strip_tags($temp[0]); } else { $spread = "pk"; } // find totals preg_match("/OVER .*? /", $matches, $temp); if ($temp[0] != NULL) { $total = strip_tags($temp[0]); } else { preg_match("/UNDER .*? /", $matches, $temp); $total = strip_tags($temp[0]); } // output row echo '
' . $id . '' . $gameday . '' . $team . '' . $spread . '' . $total . '
'; if ($counter == 0) { echo 'No games found!'; } echo curl_error($ch); echo '
'; curl_close($ch); ?>