PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Khoa Bui   PHP Detect Country and City   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: PHP Example
Class: PHP Detect Country and City
Get the current user location using codehelper.io
Author: By
Last change: Update Example
Date: 10 years ago
Size: 568 bytes
 

Contents

Class file image Download
<?php
/*
 * Website http://www.codehelper.io
 * Author: khoaofgod@yahoo.com
 * Any bugs, question, please visit our forum at http://www.codehelper.io
 */

// Required Libraries
require_once("ip.codehelper.io.php");
require_once(
"php_fast_cache.php");

// New Class
$_ip = new ip_codehelper();

// Detect Real IP Address & Location
$real_client_ip_address = $_ip->getRealIP();
$visitor_location = $_ip->getLocation($real_client_ip_address);

// Output result
echo $visitor_location['Country']."<br>";
echo
"<pre>";
print_r($visitor_location);