public function Geocode($address) { //https://developers.google.com/maps/documentation/geocoding/index $address = str_replace(" ", "+", $address); //remove spaces $address = str_replace("&", "and", $address); //remove & $url = 'https://maps.googleapis.com/maps/api/geocode/xml?address=' . $address . '&key=' . $this->API_key; // single curl request $fetch = parent::SingleCurl($url); //$fetch[EXE] is html, $fetch[INF] is info about scrape // wait for 0.2 seconds usleep(200000); return $fetch['BODY']; }