Download the PHP package seeley/ip2location without Composer

On this page you can find all versions of the php package seeley/ip2location. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ip2location

IP2Location (PHP Module)

Latest Stable Version Total Downloads

This is the official release maintained by IP2Location.com

This PHP module provides fast lookup of country, region, city, latitude, longitude, ZIP code, time zone, ISP, domain name, connection speed, IDD code, area code, weather station code, weather station name, MNC, MCC, mobile brand, elevation, and usage type from IP address by using IP2Location database. This module uses a file based database available at IP2Location.com.

This module can be used in many types of projects such as:

  1. select the geographically closest mirror
  2. analyze your web server logs to determine the countries of your visitors
  3. credit card fraud detection
  4. software export controls
  5. display native language and currency
  6. prevent password sharing and abuse of service
  7. geotargeting in advertisement

Free IP2Location LITE and commerical databases are available for download.

Monthly update is available for both IP2Location LITE and commercial database.

KEY FEATURES

  1. Support both IPv4 and IPv6 with ease. If you would like to enable IPv6 support, you just need to replace your BIN file with IPv6 version. That's it, and no code modification needed.
  2. Extensible. If you require different granularity of IP information, you can visit IP2Location.com to download the relevant BIN file, and the information will made ready for you.
  3. Comprehensive Information. There are more than 13 types of information that you can retrieve from an IP address. Please visit IP2Location.com for details.

INSTALLATION

To install this module, unzip the package and copy the following files to your web folder.

To test this installation, please browse example.php using web browser.

USAGE

You can check the example.php file to learn more about usage.

Database Class

Below is the description of the functions available in the Database class.

Function Name Description
Constructor Expect 2 input parameters:
  1. Full path of IP2Location BIN data file.
  2. File Open Mode
    • SHARED_MEMORY
    • MEMORY_CACHE
    • FILE_IO
For SHARED_MEMORY and MEMORY_CACHE, it will require your server to have sufficient memory to hold the BIN data, otherwise it will raise the errors during the object initialization.
getDate Return the database's compilation date as a string of the form 'YYYY-MM-DD'
getType Return the database's type, 1 to 24 respectively for DB1 to DB24. Please visit https://www.ip2location.com/databases for details.
getModuleVersion Return the version of module
getDatabaseVersion Return the version of database
lookup Return the IP information in array. Below is the information returned:
  • ipNumber
  • ipVersion
  • ipAddress
  • countryCode
  • countryName
  • regionName
  • cityName
  • latitude
  • longitude
  • areaCode
  • iddCode
  • weatherStationCode
  • weatherStationName
  • mcc
  • mnc
  • mobileCarrierName
  • usageType
  • elevation
  • netSpeed
  • timeZone
  • zipCode
  • domainName
  • isp
You can visit IP2Location for the description of each field. Note: although the above names are not exactly matched with the names given in this link, but they are self-described.
getCidr Return an array of the sub-network of an IP address.

WebService Class

Below is the description of the functions available in the WebService class.

Function Name Description
Constructor Expect 3 input parameters:
  1. IP2Location API Key.
  2. Package (WS1 - WS24)
  3. Use HTTPS or HTTP
lookup Return the IP information in array.
  • country_code
  • country_name
  • region_name
  • city_name
  • latitude
  • longitude
  • zip_code
  • time_zone
  • isp
  • domain
  • net_speed
  • idd_code
  • area_code
  • weather_station_code
  • weather_station_name
  • mcc
  • mnc
  • mobile_brand
  • elevation
  • usage_type
  • continent
    • name
    • code
    • hemisphere
    • translations
  • country
    • name
    • alpha3_code
    • numeric_code
    • demonym
    • flag
    • capital
    • total_area
    • population
    • currency
      • code
      • name
      • symbol
    • language
      • code
      • name
    • idd_code
    • tld
    • translations
  • region
    • name
    • code
    • translations
  • city
    • name
    • translations
  • geotargeting
    • metro
  • country_groupings
  • time_zone_info
    • olson
    • current_time
    • gmt_offset
    • is_dst
    getCredit Return remaining credit of the web service account.

    DEPENDENCIES

    This library requires IP2Location BIN data file to function. You may download the BIN data file at

    An outdated BIN database was provided in the databases folder for your testing. You are recommended to visit the above links to download the latest BIN database.

    You can also sign up for IP2Location Web Service to lookup by IP2Location API.

    IPv4 BIN vs IPv6 BIN

    OTHER FRAMEWORK LIBRARY

    Below are the list of other framework library that you can install and use right away.

    COPYRIGHT AND LICENCE

    Copyright (C) 2005-2020 by IP2Location.com

    License under MIT


    All versions of ip2location with dependencies

    PHP Build Version
    Package Version
    No informations.
    Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

    The package seeley/ip2location contains the following files

    Loading the files please wait ....