"; while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { $response = json_decode( file_get_contents( sprintf("http://labs.silverbiology.com/countylookup/lookup.php?cmd=findCounty&DecimalLatitude=%s&DecimalLongitude=%s", $data[1], $data[2] ) ) ); if ($response->success) { $county = trim( str_replace( array('Parish', 'County'), '', $data[4] ) ); $county = str_replace( 'St.', 'St', $county ); if ($response->County != $county) { $output = implode( ",", array( $data[0], $data[1], $data[2], $data[3], $data[4], $response->State, $response->County, "\"http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=" . $data[1] . "," . $data[2] . "\"" ) ) . "\r\n"; file_put_contents( $output_file, $output, FILE_APPEND ); $b++; } else { $g++; } if ((($g + $b) % 5) == 0) { print "Good: $g Bad: $b
"; } } } fclose($handle); ?>