I am parsing a website, by first splitting the html into an array. (It's a page I wrote; I'm just trying to learn how this works).
I'm trying to extract info from the array, and it's not acting as I'd expected. The array ends up with 204 lines. I only want some:
$g=0;$h=0;
for ($i=0;$i<$count;$i++){[INDENT] $this=$page_array[$i];
if (substr($this,-5)=='vis">'){ [INDENT]$next=$i+1;
$vis[$g]=$page_array[$next];
$g++;[/INDENT]
}else if (substr($this,-6)=='home">'){ [INDENT]$next=$i+1;
$home[$h]=$page_array[$next];
$h++;[/INDENT]
}else {}
[/INDENT]
}
This returns the following results:
Array ( [0] => Pittsburgh [1] => Carolina [2] => Tampa Bay [3] => New England [4] => Kansas City [5] => St. Louis [6] => Cleveland [7] => Tennessee [8] => Houston [9] => Detroit [10] => Green Bay [11] => Jacksonville [12] => Arizona [13] => N.Y. Giants [14] => Washington [15] => Oakland )
HOME above. VIS below.
Array ( [0] => Miami [1] => Atlanta [2] => Baltimore [3] => Buffalo [4] => Cincinnati [5] => Denver [6] => New Orleans [7] => N.Y. Jets [8] => Philadelphia [9] => Seattle [10] => Chicago [11] => Dallas [12] => San Francisco [13] => Indianapolis [14] => Minnesota [15] => San Diego ) [31] => [32] => [33] => Atlanta [34] => [35] => [36] => Carolina [37] => [38] => [39] => 1:00 p.m. [40] => [41] => [42] => [43] => [44] => Baltimore [45] => [46] => [47] => Tampa Bay [48] => [49] => [50] => 1:00 p.m. [51] => [52] =>
Where is the red part coming from?
Why is it only in the VIS section?
and How do I get rid of it?
Thanks.