マーク B は正しいです。しかし、ちょっとした強引な力が必要な場合もあります。おそらく、Marc B は真の HTML 解析済みの回答を提供できます。
$homepage = file_get_contents('http://linesfeed.com/nfl');
preg_match_all("'(<tr)|<td style=\'width:auto;color:#424241\' align=\'center\' valign=\'top\'>([^<]*)</td>'si", $homepage, $match);
$games = trim( implode('|',$match[2]), "| ");
$games = explode('||', str_replace( '||', '|', $games ));
foreach($games as $key => $game)
{
$gamedata = explode('|', $game );
$date = $gamedatas[0];
$visit = $gamedata[1];
$home = $gamedata[6];
// insert into games (date,visiting_team,home_team) values( $date, $visit, $home ) ...
}
$games の結果
Array
(
[0] => 09.05.13|Ravens (Baltimore)|8.0 (-110) |+290|48.5o (-110)|8:35 PM|Broncos (Denver)|-8.0 (-110) |-350|48.5u (-110)
[1] => 09.08.13|Patriots (NewEngland)|-11.5 (-110) |-630|48.5o (-110)|1:05 PM|Bills (Buffalo)|11.5 (-110) |+465|48.5u (-110)
[2] => 09.08.13|Titans (Tennessee)|7.0 (-110) |+250|42.0o (-110)|1:05 PM|Steelers (Pittsburgh)|-7.0 (-110) |-300|42.0u (-110)
[3] => 09.08.13|Falcons (Atlanta)|3.0 (even) |+140|54.5o (-110)|1:05 PM|Saints (NewOrleans)|-3.0 (-120) |-160|54.5u (-110)
[4] => 09.08.13|Buccaneers (TampaBay)|-3.5 (-110) |-180|40.0o (-110)|1:05 PM|Jets (NewYork)|3.5 (-110) |+160|40.0u (-110)
[5] => 09.08.13|Chiefs (KansasCity)|-4.0 (-110) |-190|41.0o (-110)|1:05 PM|Jaguars (Jacksonville)|4.0 (-110) |+165|41.0u (-110)
[6] => 09.08.13|Bengals (Cincinnati)|3.0 (-120) |+130|41.5o (-110)|1:05 PM|Bears (Chicago)|-3.0 (even) |-150|41.5u (-110)
[7] => 09.08.13|Dolphins (Miami)|0.0 (-110) |OFF|41.0o (-110)|1:05 PM|Browns (Cleveland)|0.0 (-110) |OFF|41.0u (-110)
[8] => 09.08.13|Seahawks (Seattle)|-3.5 (-115) |-170|45.0o (-110)|1:05 PM|Panthers (Carolina)|3.5 (-105) |+150|45.0u (-110)
[9] => 09.08.13|Vikings (Minnesota)|5.0 (-110) |+175|46.5o (-110)|1:05 PM|Lions (Detroit)|-5.0 (-110) |-210|46.5u (-110)
[10] => 09.08.13|Raiders (Oakland)|10.0 (-115) |+350|47.0o (-110)|1:05 PM|Colts (Indianapolis)|-10.0 (-105) |-450|47.0u (-110)
[11] => 09.08.13|Cardinals (Arizona)|4.5 (-110) |+180|40.0o (-110)|4:30 PM|Rams (StLouis)|-4.5 (-110) |-220|40.0u (-110)
[12] => 09.08.13|Packers (GreenBay)|4.5 (-110) |+180|48.5o (-110)|4:30 PM|49ers (SanFrancisco)|-4.5 (-110) |-220|48.5u (-110)
[13] => 09.08.13|Giants (NewYork)|3.0 (-105) |+145|48.5o (-110)|8:35 PM|Cowboys (Dallas)|-3.0 (-115) |-165|48.5u (-110)
[14] => 09.09.13|Eagles (Philadelphia)|3.5 (-110) |+165|51.0o (-110)|7:15 PM|Redskins (Washington)|-3.5 (-110) |-190|51.0u (-110)
[15] => 09.09.13|Texans (Houston)|-4.0 (-110) |-200|44.0o (-110)|10:25 PM|Chargers (SanDiego)|4.0 (-110) |+170|44.0u (-110)
)
データベース挿入の結果
Date Visiting Team Home Team
09.05.13 Ravens (Baltimore) Broncos (Denver)
09.08.13 Patriots (NewEngland) Bills (Buffalo)
09.08.13 Titans (Tennessee) Steelers (Pittsburgh)
09.08.13 Falcons (Atlanta) Saints (NewOrleans)
09.08.13 Buccaneers (TampaBay) Jets (NewYork)
09.08.13 Chiefs (KansasCity) Jaguars (Jacksonville)
09.08.13 Bengals (Cincinnati) Bears (Chicago)
09.08.13 Dolphins (Miami) Browns (Cleveland)
09.08.13 Seahawks (Seattle) Panthers (Carolina)
09.08.13 Vikings (Minnesota) Lions (Detroit)
09.08.13 Raiders (Oakland) Colts (Indianapolis)
09.08.13 Cardinals (Arizona) Rams (StLouis)
09.08.13 Packers (GreenBay) 49ers (SanFrancisco)
09.08.13 Giants (NewYork) Cowboys (Dallas)
09.09.13 Eagles (Philadelphia) Redskins (Washington)
09.09.13 Texans (Houston) Chargers (SanDiego)