Introduction to writing spiders and agents
Parsing links step 1: Inclusive parse script
    Returns an array of all links in $downloaded_page
    $link_array = inclusive_parse(
            $page=$downloaded_page,
            $start="href",
            $end=">",
            $max_span="50"
            );
function inclusive_parse($page, $start, $end, $max_span) { $search_string = $page; # ELIMINATE EVERYTHING UPTO THE START CRITERIA while( $found = stristr($search_string, $start)) { # LOOK FOR THE END CRITERIA, WITHOUT EXCEEDING MAX_SPAN for ($xx=0; $xx<$max_span; $xx++) { if ($found[$xx] == $end) { break; } } # GATHER EVERYTHING BETWEEN START AND END SEARCH CRITERIA $data = substr($found, strlen($start), $xx-strlen($start)); # PUSH IT INTO AN ARRAY $array[] = $data; # REDUCE AMOUNT LEFT TO TO AND START AGAIN $search_string = substr($found, strlen($start)+$xx); } return $array; }