Skip to content

Commit 48b6e7d

Browse files
committed
Get geolocation method call, and variables renaming
1 parent 9ba6756 commit 48b6e7d

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

ip-geolocation-api-php.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
<?php
22
$apiKey = "PUT_YOUR_API_KEY_HERE";
33
$ip = "CLIENT_IP_ADDRESS";
4-
$response = get_location($apiKey, $ip);
5-
$json = array();
6-
$json = json_decode($response, true);
4+
$location = get_geolocation($apiKey, $ip);
5+
$decodedLocation = json_decode($location, true);
76

87
echo "<pre>";
9-
print_r($json);
8+
print_r($decodedLocation);
109
echo "</pre>";
1110

1211
function get_geolocation($apiKey, $ip, $lang = "en", $fields = "*", $excludes = "") {

0 commit comments

Comments
 (0)