We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 13f10b0 commit 24389feCopy full SHA for 24389fe
1 file changed
ip-geolocation-api-php.php
@@ -0,0 +1,25 @@
1
+
2
+<?php
3
4
+$response = get_web_page("https://api.ipgeolocation.io/ipgeo?apiKey=d9d46f08bfb34ee59e4e8c74f07bb449&ip=103.255.5.105");
5
+$resArr = array();
6
+$resArr = json_decode($response);
7
+echo "<pre>"; print_r($resArr); echo "</pre>";
8
9
+function get_web_page($url) {
10
+ $cURL = curl_init();
11
+ curl_setopt($cURL, CURLOPT_URL, $url);
12
+ curl_setopt($cURL, CURLOPT_HTTPGET, true);
13
14
+curl_setopt($cURL, CURLOPT_HTTPHEADER, array(
15
+ 'Content-Type: application/json',
16
+ 'Accept: application/json'
17
+));
18
19
+ $content = curl_exec($cURL);
20
21
+ curl_close($cURL);
22
23
+ return $content;
24
+}
25
+?>
0 commit comments