fetch("http://www.xscores.com/soccer/all_games/$sdate");
$txt = $snoopy->results;
$tag0 = '/
(.*?)<\/a><\/td>/i';
$tag1 = '/ (.*?)<\/b><\/td>/';
$tag2 = '/ (.*?)<\/td>/i';
$tag21 = '/(.*?)<\/b>.*?<\/font><\/td>/i';
$tag3 = '/ .*?<\/a><\/td>
(.*?)<\/div><\/td>/i';
$tag4 = '/
.*?<\/td>
(.*?)<\/b><\/td>/i';
$tag5 = '/
(.*?)<\/div><\/td>
.*?<\/td>/i';
$tag6 = '/ (.*?)<\/td>
.*?<\/b><\/td>/i';
preg_match_all($tag0, $txt, $matches1, PREG_SET_ORDER);
preg_match_all($tag1, $txt, $matches2, PREG_SET_ORDER);
preg_match_all($tag2, $txt, $matches3, PREG_SET_ORDER);
preg_match_all($tag21, $txt, $matches31, PREG_SET_ORDER);
preg_match_all($tag3, $txt, $matches4, PREG_SET_ORDER);
preg_match_all($tag4, $txt, $matches5, PREG_SET_ORDER);
preg_match_all($tag5, $txt, $matches6, PREG_SET_ORDER);
preg_match_all($tag6, $txt, $matches7, PREG_SET_ORDER);
function sum_the_time($time1, $time2) {
$times = array($time1, $time2);
$seconds = 0;
foreach ($times as $time){
list($hour,$minute) = explode(':', $time);
$seconds += $days*3600*24;
$seconds += $hour*3600;
$seconds += $minute*60;
}
$days = floor($seconds/(3600*24));
$seconds -= $days*3600*24;
$hours = floor($seconds/3600);
$seconds -= $hours*3600;
$minutes = floor($seconds/60);
$seconds -= $minutes*60;
return "{$hours}:{$minutes}";
}
?>
리그명
시간
상태
홈팀
스코어
원정팀
전반
"", ")" => "");
if ($month=="04" or $month=="05" or $month=="06" or $month=="07" or $month=="08" or $month=="09" or $month=="10")
$dst = "06:00";
else $dst = "07:00";
echo sum_the_time(strtr($matches2[$cnt][1], $trans), $dst); //시간 ?>
경기 일정이 없습니다. ";
?>