} //end if loctype = locality if ($i == $length - 1) { //if last element and no loc type then move to next loc type and start over $i_type++; } $i++; sleep(2); //give geocoder a rest so no over_query_limit error } //end foreach locs } while (!$match); //end do while no loc types match } else { $location = geocoder::getLocation($loc); $formatted_address = geocoder::getFormatted($loc); } $lat = $location['lat']; $lng = $location['lng']; /*echo "location array: "; print_r($location); //////////////////debug echo "<br/>formated address: " . $formatted_address; ////////////////////////debug* / $locs = explode(',', $loc); //create an array of locations delimited by comma echo "<br/>locations delimited: "; print_r($locs); foreach($locs as $value){ $one = urlencode($value); echo "<br/>urlencoded: " . $one; echo "<br/>types: " . geocoder::getLocType($one); }/////////////////////////////////////debug*/