Hi,
I'm having a strange problem. The task: search on a site and get the all the dates from a particular season. Everything goes well for all the mondays, tuesdays, ... , saturday. But at Sunday I only get 2 results and I need 11 results. Now when I only search for Sunday it does give me 11 results.
Does anyone know what could be the problem? Is an array only limited to 80 values? Because I get only 80 results (but I should be 89).
Here is the script:
$html1 = "http://sports.espn.go.com/nba/teams/schedule?team=" . $datateam . "&year=2007";
$array1 = file_get_contents($html1);
preg_match_all('/<nobr>Mon, ([\s\d\w]+)/',$array1,$mon);
for($c=0;$c < count($mon[1]);$c++){
$explode = explode(" ", $mon[1][$c]);
$dag1[$c] = $explode[1];
$maand1explode = $explode[0];
if($maand1explode == "Oct"){
$maand1[$c] = "10";
$jaar1[$c] = "2006";
}elseif($maand1explode == "Nov"){
$maand1[$c] = "11";
$jaar1[$c] = "2006";
}elseif($maand1explode == "Dec"){
$maand1[$c] = "12";
$jaar1[$c] = "2006";
}elseif($maand1explode == "Jan"){
$maand1[$c] = "1";
$jaar1[$c] = "2007";
}elseif($maand1explode == "Feb"){
$maand1[$c] = "2";
$jaar1[$c] = "2007";
}elseif($maand1explode == "Mar"){
$maand1[$c] = "3";
$jaar1[$c] = "2007";
}elseif($maand1explode == "Apr"){
$maand1[$c] = "4";
$jaar1[$c] = "2007";
}elseif($maand1explode == "May"){
$maand1[$c] = "5";
$jaar1[$c] = "2007";
}elseif($maand1explode == "Jun"){
$maand1[$c] = "6";
$jaar1[$c] = "2007";
}
}
preg_match_all('/<nobr>Tue, ([\s\d\w]+)/',$array1,$tue);
for($d=0;$d < count($tue[1]);$d++){
$explode = explode(" ", $tue[1][$d]);
array_push($dag1,$explode[1]);
$maand1explode = $explode[0];
if($maand1explode == "Oct"){
array_push($maand1,"10");
array_push($jaar1,"2006");
}elseif($maand1explode == "Nov"){
array_push($maand1,"11");
array_push($jaar1,"2006");
}elseif($maand1explode == "Dec"){
array_push($maand1,"12");
array_push($jaar1,"2006");
}elseif($maand1explode == "Jan"){
array_push($maand1,"1");
array_push($jaar1,"2007");
}elseif($maand1explode == "Feb"){
array_push($maand1,"2");
array_push($jaar1,"2007");
}elseif($maand1explode == "Mar"){
array_push($maand1,"3");
array_push($jaar1,"2007");
}elseif($maand1explode == "Apr"){
array_push($maand1,"4");
array_push($jaar1,"2007");
}elseif($maand1explode == "May"){
array_push($maand1,"5");
array_push($jaar1,"2007");
}elseif($maand1explode == "Jun"){
array_push($maand1,"6");
array_push($jaar1,"2007");
}
}
preg_match_all('/<nobr>Wed, ([\s\d\w]+)/',$array1,$wed);
for($e=0;$e < count($wed[1]);$e++){
$explode = explode(" ", $wed[1][$e]);
array_push($dag1,$explode[1]);
$maand1explode = $explode[0];
if($maand1explode == "Oct"){
array_push($maand1,"10");
array_push($jaar1,"2006");
}elseif($maand1explode == "Nov"){
array_push($maand1,"11");
array_push($jaar1,"2006");
}elseif($maand1explode == "Dec"){
array_push($maand1,"12");
array_push($jaar1,"2006");
}elseif($maand1explode == "Jan"){
array_push($maand1,"1");
array_push($jaar1,"2007");
}elseif($maand1explode == "Feb"){
array_push($maand1,"2");
array_push($jaar1,"2007");
}elseif($maand1explode == "Mar"){
array_push($maand1,"3");
array_push($jaar1,"2007");
}elseif($maand1explode == "Apr"){
array_push($maand1,"4");
array_push($jaar1,"2007");
}elseif($maand1explode == "May"){
array_push($maand1,"5");
array_push($jaar1,"2007");
}elseif($maand1explode == "Jun"){
array_push($maand1,"6");
array_push($jaar1,"2007");
}
}
preg_match_all('/<nobr>Thu, ([\s\d\w]+)/',$array1,$thu);
for($f=0;$f < count($thu[1]);$f++){
$explode = explode(" ", $thu[1][$f]);
array_push($dag1,$explode[1]);
$maand1explode = $explode[0];
if($maand1explode == "Oct"){
array_push($maand1,"10");
array_push($jaar1,"2006");
}elseif($maand1explode == "Nov"){
array_push($maand1,"11");
array_push($jaar1,"2006");
}elseif($maand1explode == "Dec"){
array_push($maand1,"12");
array_push($jaar1,"2006");
}elseif($maand1explode == "Jan"){
array_push($maand1,"1");
array_push($jaar1,"2007");
}elseif($maand1explode == "Feb"){
array_push($maand1,"2");
array_push($jaar1,"2007");
}elseif($maand1explode == "Mar"){
array_push($maand1,"3");
array_push($jaar1,"2007");
}elseif($maand1explode == "Apr"){
array_push($maand1,"4");
array_push($jaar1,"2007");
}elseif($maand1explode == "May"){
array_push($maand1,"5");
array_push($jaar1,"2007");
}elseif($maand1explode == "Jun"){
array_push($maand1,"6");
array_push($jaar1,"2007");
}
}
preg_match_all('/<nobr>Fri, ([\s\d\w]+)/',$array1,$fri);
for($g=0;$g< count($fri[1]);$g++){
$explode = explode(" ", $fri[1][$g]);
array_push($dag1,$explode[1]);
$maand1explode = $explode[0];
if($maand1explode == "Oct"){
array_push($maand1,"10");
array_push($jaar1,"2006");
}elseif($maand1explode == "Nov"){
array_push($maand1,"11");
array_push($jaar1,"2006");
}elseif($maand1explode == "Dec"){
array_push($maand1,"12");
array_push($jaar1,"2006");
}elseif($maand1explode == "Jan"){
array_push($maand1,"1");
array_push($jaar1,"2007");
}elseif($maand1explode == "Feb"){
array_push($maand1,"2");
array_push($jaar1,"2007");
}elseif($maand1explode == "Mar"){
array_push($maand1,"3");
array_push($jaar1,"2007");
}elseif($maand1explode == "Apr"){
array_push($maand1,"4");
array_push($jaar1,"2007");
}elseif($maand1explode == "May"){
array_push($maand1,"5");
array_push($jaar1,"2007");
}elseif($maand1explode == "Jun"){
array_push($maand1,"6");
array_push($jaar1,"2007");
}
}
preg_match_all('/<nobr>Sat, ([\s\d\w]+)/',$array1,$sat);
for($h=0;$h < count($sat[1]);$h++){
$explode = explode(" ", $sat[1][$h]);
array_push($dag1,$explode[1]);
$maand1explode = $explode[0];
if($maand1explode == "Oct"){
array_push($maand1,"10");
array_push($jaar1,"2006");
}elseif($maand1explode == "Nov"){
array_push($maand1,"11");
array_push($jaar1,"2006");
}elseif($maand1explode == "Dec"){
array_push($maand1,"12");
array_push($jaar1,"2006");
}elseif($maand1explode == "Jan"){
array_push($maand1,"1");
array_push($jaar1,"2007");
}elseif($maand1explode == "Feb"){
array_push($maand1,"2");
array_push($jaar1,"2007");
}elseif($maand1explode == "Mar"){
array_push($maand1,"3");
array_push($jaar1,"2007");
}elseif($maand1explode == "Apr"){
array_push($maand1,"4");
array_push($jaar1,"2007");
}elseif($maand1explode == "May"){
array_push($maand1,"5");
array_push($jaar1,"2007");
}elseif($maand1explode == "Jun"){
array_push($maand1,"6");
array_push($jaar1,"2007");
}
}
preg_match_all('/<nobr>Sun, ([\s\d\w]+)/',$array1,$sun);
for($j=0;$j < count($sun[1]);$j++){
$explode = explode(" ", $sun[1][$j]);
array_push($dag1,$explode[1]);
$maand1explode = $explode[0];
if($maand1explode == "Oct"){
array_push($maand1,"10");
array_push($jaar1,"2006");
}elseif($maand1explode == "Nov"){
array_push($maand1,"11");
array_push($jaar1,"2006");
}elseif($maand1explode == "Dec"){
array_push($maand1,"12");
array_push($jaar1,"2006");
}elseif($maand1explode == "Jan"){
array_push($maand1,"1");
array_push($jaar1,"2007");
}elseif($maand1explode == "Feb"){
array_push($maand1,"2");
array_push($jaar1,"2007");
}elseif($maand1explode == "Mar"){
array_push($maand1,"3");
array_push($jaar1,"2007");
}elseif($maand1explode == "Apr"){
array_push($maand1,"4");
array_push($jaar1,"2007");
}elseif($maand1explode == "May"){
array_push($maand1,"5");
array_push($jaar1,"2007");
}elseif($maand1explode == "Jun"){
array_push($maand1,"6");
array_push($jaar1,"2007");
}
}
// Expert ID
//
//
for($x=0; $x < count($expertname);$x++){
$urlexpert = "http://spaces.covers.com/" . $expertname[$x] . "?t=0";
$urlexpertstring = file_get_contents($urlexpert);
preg_match('/user=([-0-9]+)&/',$urlexpertstring,$matchexpert);
$expertid[$x] = $matchexpert[1];
if($expertid[$x] == ""){
preg_match('/userID=([\d]+)/',$urlexpertstring, $matchexpertextra);
$expertidfinal = $matchexpertextra[1];
}else{
$expertidfinal = $expertid[$x];
}
$expert[$x] = $expertidfinal;
}
for($k=0;$k<count($dag);$k++){
print("'" . $dag1[$k] . "-" . $maand1[$k] . "-" . $jaar1[$k]);
?><br><?
}
Grtz