PHP Package: mlocati/ip-lib

IP-lib is a PHP library for handling IP addresses efficiently and accurately, providing useful tools for IP address validation, manipulation, and geolocation.

Current Version: 1.21.0
Last Updated: 2025-09-24
PHP Requirement: >=5.3.3
Dependencies:
mlocati/php-cs-fixer-config
php-fig/log
⚠️ To ensure full functionality, the above dependencies might be required.

Package Description

IP-lib is a versatile PHP library designed to simplify the handling of IP addresses with precision and efficiency. With a range of functions for IP address validation, manipulation, and geolocation, this library streamlines the process of working with IP data, making it an indispensable tool for developers working on networking or geolocation projects.

📦 Show all available classes🔗 View on GitHub

Download Latest Version: 1.21.0

Download Download v1.21.0

Previous Versions

Code Integration Example

Make sure to include the correct namespace and class paths for proper usage.

<?php
// Example from PHPlibraries.com
require_once 'libs/mlocati/ip-lib/1.21.0/loader.php';
require_once 'libs/mlocati/php-cs-fixer-config/{lib_version}/loader.php';
require_once 'libs/php-fig/log/3.0.2/loader.php';

use MLocati\IP\IPAddress;
use MLocati\IP\IPv4Address;
use MLocati\IP\IPv6Address;

$obj = new IPAddress();
echo '✅ Test OK: ' . get_class($obj);
?>

We aim to make using PHP packages easier without Composer. If something doesn't work, let us know — we'll fix it promptly.

Community Discussion

Ask questions, share tips, or report issues below.