0 && $ndollarsigns < 10){ $max_cost = 0; $pos = -1; while(($pos = strpos($text, '$', $pos+1)) !== false){ $new_cost = (int)substr($text, $pos+1); if($new_cost > $max_cost){ $max_cost = $new_cost; if($debug_info){ print("found a price of $max_cost \n"); } } } if($max_cost > 0){ $costs[] = $max_cost; $summary_lengths[] = strlen($text); } } //Now the function will recursively walk through the new links that were found. if($depth > 1){ $link_list_s2 = count($link_list); for($i = $link_list_s; $i < $link_list_s2; $i++){ CrawlPage( $base_url, $link_list[$i], $link_list, $avoid_cgi, $depth-1, $debug_info, $costs, $summary_lengths); } } } $url_list = array(); $costs = array(); $summary_lengths = array(); CrawlPage("craigslist", "http://www.craigslist.com/apa/", $url_list, true, 3, true, $costs, $summary_lengths); print("exited function --- \n"); for($i = 0; $i < count($url_list); $i++){ print($url_list[$i]." ----\n"); } print("cost,SummaryLength\n"); for($i = 0; $i < count($costs); $i++){ print($costs[$i].",".$summary_lengths[$i]."\n"); } ?>