Title: carterconnection21's Replies | WordPress.org

---

# carterconnection21

  [  ](https://wordpress.org/support/users/carterconnection21/)

 *   [Profile](https://wordpress.org/support/users/carterconnection21/)
 *   [Topics Started](https://wordpress.org/support/users/carterconnection21/topics/)
 *   [Replies Created](https://wordpress.org/support/users/carterconnection21/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/carterconnection21/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/carterconnection21/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/carterconnection21/engagements/)
 *   [Favorites](https://wordpress.org/support/users/carterconnection21/favorites/)

 Search replies:

## Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[BePro Listings] google maps api curl call](https://wordpress.org/support/topic/google-maps-api-curl-call/)
 *  Thread Starter [carterconnection21](https://wordpress.org/support/users/carterconnection21/)
 * (@carterconnection21)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/google-maps-api-curl-call/#post-4491869)
 * Didn’t know that.
 * Thanks.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[BePro Listings] google maps api curl call](https://wordpress.org/support/topic/google-maps-api-curl-call/)
 *  Thread Starter [carterconnection21](https://wordpress.org/support/users/carterconnection21/)
 * (@carterconnection21)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/google-maps-api-curl-call/#post-4491855)
 * The curl call wasn’t bringing the results back even though the url was correct.
   So the simpler thing to do is use file_get_contents().
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[BePro Listings] google maps api curl call](https://wordpress.org/support/topic/google-maps-api-curl-call/)
 *  Thread Starter [carterconnection21](https://wordpress.org/support/users/carterconnection21/)
 * (@carterconnection21)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/google-maps-api-curl-call/#post-4491854)
 * I replaced the curl call with file_get_contents();
    ` /* Replace this $ch = curl_init();
   curl_setopt($ch, CURLOPT_URL, $addresstofind_1); curl_setopt($ch, CURLOPT_USERAGENT,'
   Mozilla/5.001 (windows; U; NT4.0; en-US; rv:1.0) Gecko/25250101'); curl_setopt(
   $ch, CURLOPT_CONNECTTIMEOUT,1); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); $
   addr_search_1 = curl_exec($ch); curl_close($ch);
 * /* With */
    $addr_search_1 = file_get_contents($addresstofind_1);
 * then:
    if(!empty($addr_search_1)){ $addr_search_1 = json_decode($addr_search_1);
 *  if(!empty($addr_search_1->results)){
    if($addr_search_1->results[0]->geometry-
   >location){ $lon = (string)$addr_search_1->results[0]->geometry->location->lng;
   $lat = (string)$addr_search_1->results[0]->geometry->location->lat; } } }
 * it may be a bit much but if that array returns empty and with out a condition
   for that it will error out.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[BePro Listings] google maps api curl call](https://wordpress.org/support/topic/google-maps-api-curl-call/)
 *  Thread Starter [carterconnection21](https://wordpress.org/support/users/carterconnection21/)
 * (@carterconnection21)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/google-maps-api-curl-call/#post-4491825)
 * Correction:
 * results is an array

Viewing 4 replies - 1 through 4 (of 4 total)