CheckIP - A composer module to retrieve information from an IP address

Overview

CheckIP

A composer module to retrieve information from an IP address, using geoplugin.net

Installation

Use composer to install CheckIP

composer require ismystore/checkip

Usage

getCountry()."\n"; $msg .= "Your country code is: ".$check->getCountryCode()."\n"; $msg .= "Your region code is: ".$check->getRegionCode()."\n"; $msg .= "Your state/region name is: ".$check->getState()."\n"; $msg .= "Your city is: ".$check->getCity()."\n"; $msg .= "Your address is: ".$check->getAddress()."\n"; $msg .= "Is a european country ? ".($check->getEuropean() ? "Yes" : "No")."\n"; $msg .= "Your timezone is: ".$check->getTimezone()."\n"; $msg .= "Your currency code is: ".$check->getCurrencyCode()." (".$check->getCurrencySymbol().")\n"; $person->send($msg); } }">


use ismystore\checkip\CheckIP;

class MyAwesomeClass{
    public function getMyPlayer(Person $person){
        $ip = $person->getAddress();
        $check = new CheckIP($ip);
        
        $msg = "";
        $msg .= "Your country is: ".$check->getCountry()."\n";
        $msg .= "Your country code is: ".$check->getCountryCode()."\n";
        $msg .= "Your region code is: ".$check->getRegionCode()."\n";
        $msg .= "Your state/region name is: ".$check->getState()."\n";
        $msg .= "Your city is: ".$check->getCity()."\n";
        $msg .= "Your address is: ".$check->getAddress()."\n";
        $msg .= "Is a european country ? ".($check->getEuropean() ? "Yes" : "No")."\n";
        $msg .= "Your timezone is: ".$check->getTimezone()."\n";
        $msg .= "Your currency code is: ".$check->getCurrencyCode()." (".$check->getCurrencySymbol().")\n";
        $person->send($msg);
   }
}

Test

Make sure you are at the root of the module

php tests/test.php 
You might also like...
The spatial web mapping framework and core-module

Mapbender module This is the Mapbender module, the main-component of the Mapbender application. This module works like a library and can not run for i

A Zabbix 5.4 module to group items under Monitoring -> Latest data per Tag as it used to be with Application grouping in previous versions of Zabbix
A Zabbix 5.4 module to group items under Monitoring - Latest data per Tag as it used to be with Application grouping in previous versions of Zabbix

zabbix-module-latest-data Written according to Zabbix official documentation https://www.zabbix.com/documentation/current/manual/modules A Zabbix 5.4

A dolibarr module which pushes invoices to AADE MyDATA service

DOLIBARR ERP & CRM MODULE FOR GREEK AADE MYDATA This Dolibarr module pushes invoices to AADE MyDATA Check also that the /custom directory is active by

Provide a module to industrialize API REST call with dependency injection using Guzzle library
Provide a module to industrialize API REST call with dependency injection using Guzzle library

Zepgram Rest Technical module to industrialize API REST call with dependency injection using Guzzle library. Provides multiple features to make your l

Task Manager is a Task Management Module/Tools for wordpress

Task Manager is a Task Management Module/Tools for wordpress, where you can create, manage, assign user, update and delete different tasks. It has all features of Task Management Application.

QuidPHP/Navigation contains a JavaScript module for a website navigation without reloading.

QuidPHP/Navigation contains a JavaScript module for a website navigation without reloading.

Track any ip address with IP-Tracer. IP-Tracer is developed for Linux and Termux. you can retrieve any ip address information using IP-Tracer.
Track any ip address with IP-Tracer. IP-Tracer is developed for Linux and Termux. you can retrieve any ip address information using IP-Tracer.

IP-Tracer is used to track an ip address. IP-Tracer is developed for Termux and Linux based systems. you can easily retrieve ip address information using IP-Tracer. IP-Tracer use ip-api to track ip address.

Simple searching for postcodes to retrieve geographic information. Support for various API providers and a unified address/output format.

Postcode Search Simple searching for postcodes to retrieve geographic information. Support for various API providers and a unified address/output form

The library resolves the address of the nearest server to you by domain name and Your IP address

PHP Domain DNS 🍑 The library resolves the address of the nearest server to you by domain name and Your IP address Installing $ composer require kayw-

This is a PHP library developed for Symfony to collect address information.

Goldbach Algorithms Address Info Getter (fondly nicknamed AIG) is a PHP library developed for Symfony to collect address information.

How to get cookies from users' browser and send the information to your email address and telegram bot

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

A composer plugin, to install differenty types of composer packages in custom directories outside the default composer default installation path which is in the vendor folder.

composer-custom-directory-installer A composer plugin, to install differenty types of composer packages in custom directories outside the default comp

CRUD  Build a system to insert student name information, grade the class name, and edit and delete this information
CRUD Build a system to insert student name information, grade the class name, and edit and delete this information

CRUD Build a system to insert student name information, grade the class name, and edit and delete this information

Magento 2 module for displaying additional information in configuration
Magento 2 module for displaying additional information in configuration

AvS_ScopeHint for Magento 2 Displays a hint when a configuration value is overwritten on a lower scope (website or store view). Facts version: 1.0.0-b

Display some useful information in the reports module.
Display some useful information in the reports module.

Useful information in the reports module : xclass, ajax, cliKeys, eID, general status of the system (encoding, DB, php vars...), hooks, compare local and TER extension (diff), used content type, used plugins, ExtDirect... It can really help you during migration or new existing project (to have a global reports of the system).

Store and retrieve objects from Algolia or Elasticsearch
Store and retrieve objects from Algolia or Elasticsearch

Store and retrieve objects from a search index This is an opinionated Laravel 5.1 package to store and retrieve objects from a search index. Currently

A Laravel package to retrieve pageviews and other data from Google Analytics
A Laravel package to retrieve pageviews and other data from Google Analytics

Retrieve data from Google Analytics Using this package you can easily retrieve data from Google Analytics. Here are a few examples of the provided met

Use auto generated UUID slugs to identify and retrieve your Eloquent models.

Laravel Eloquent UUID slug Summary About Features Requirements Installation Examples Compatibility table Alternatives Tests About By default, when get

Retrieve the GitHub Sponsors of a given user/organization.

Laravel GitHub Sponsors Retrieve the GitHub Sponsors of any user/organization and check if someone is sponsoring you. Installation composer require as

Comments
  • Dev to main

    Dev to main

    Add blacklist coutries (https://github.com/IsMyStore/CheckIP/commit/8fe96d9b21b8ee3075204d68e53e5086303f7450) Fix minimum php version too low (https://github.com/IsMyStore/CheckIP/commit/27ed166c1d163338e00f3904bab060230e28dc2d) Fix inconsistencies (https://github.com/IsMyStore/CheckIP/commit/958e4342cca3ee22ab8aa922dd172c882db5f525)

    opened by Steellgold 0
Releases(1.0.2)
Owner
IsMyStore
IsMyStore
Retrieve MySejahtera App's data from MySejahtera API and show to users via web browser. Written in PHP

MySejahtera-PHP-Web Retrieve MySejahtera App's data from MySejahtera API and show to users via web browser. Written in PHP. Disclaimer This web app is

Sam Sam 3 Oct 21, 2022
phpIPAM is an open-source web IP address management application.

phpIPAM is an open-source web IP address management application. Its goal is to provide light and simple IP address management application. It is ajax-based using jQuery libraries, it uses php scripts and javascript and some HTML5/CSS3 features, so some modern browser is preferred to be able to display javascript quickly and correctly.

Miha Petkovsek 1.8k Dec 31, 2022
phpSysInfo: a customizable PHP script that displays information about your system nicely

phpSysInfo Copyright (c), 1999-2008, Uriah Welcome (sf.net/users/precision) Copyright (c), 1999-2009, Michael Cramer (sf.net/users/bigmichi1) Copyrigh

phpSysInfo 1.3k Jan 1, 2023
This is a plugin written in PHP programming language and running on the PocketMine platform that works stably on the API 4.0.0 platform. It allows you to query some other server information

QueryServer This is a plugin written in PHP programming language and running on the PocketMine platform that works stably on the API 4.0.0 platform. I

Thành Nhân 1 Jul 6, 2022
Infopanel is a simple tool getting some information from source. It works basically like a slider that shows only title, image, a little bit description and QR-Code for links.

Infopanel is a simple tool getting some information from source. It works basically like a slider that shows only title, image, a little bit description and QR-Code for links. It has its own GUI for the editing. The GUI provides a very simple role concept. This tool can be used for digital signage, Information panels, News or Events or similar.

null 4 Aug 22, 2022
Translate laravel resource, vendor, folder or file from google translation without requiring any api information

⚡ ⚡ ⚡ Laravel Go Translate Translate laravel resource, vendor, folder or file from google translation without requiring any api information. Table of

CodeBugLab 37 Jun 18, 2022
Online chatting application through a logical decentralized blockchain network that stores chat information and hashing keys implemented using AJAX, JQuery, PHP, SQL, CSS, and HTML

Online chatting application through a logical decentralized blockchain network that stores chat information and hashing keys implemented using AJAX, JQuery, PHP, SQL, CSS, and HTML. The blockchain stores a previous hash value, current hash value, time, chat data, and a special key(nonce) used for encryption in each block (node).

Dave Sharma 1 Jan 4, 2022
A Full Stack login/register system using a MySQL database to store the information

This is a Full Stack login/register system using a MySQL database to store the information. I created this to sharpen my Full Stack Development skills.

Farhan Khan 6 Jun 25, 2022
Library JGU is a website created for a university library system information. Made with PHP & TailwindCSS.

Library JGU Library JGU is a website created for a university library system information. Made with PHP & TailwindCSS. Key Features • How To Use • Rel

Azkazikna Ageung Laksana 23 Oct 7, 2022
A Multi-Framework Composer Library Installer

A Multi-Framework Composer Library Installer This is for PHP package authors to require in their composer.json. It will install their package to the c

Composer 1.4k Jan 3, 2023