PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Meraj-Ul Islam   PHP Cloudflare IP GEO   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example usage of the class
Class: PHP Cloudflare IP GEO
Get the IP of a user of a site that uses Cloudfare
Author: By
Last change:
Date: 4 years ago
Size: 388 bytes


Class file image Download
// require the class

// initialize the class
$cf = new cfGeo;

// get user's IP
echo 'IP: '.$cf->getClientIp().'<br>';

// get user's county code in ISO format
echo 'Country Code: '.$cf->getCountryCode().'<br>';

// get user's country name
echo 'Country Name: '.$cf->getCountryName().'<br>';

/* Your site need to be intergrated to cloudflare */