Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Workflow Status Packagist License Packagist PHP Version Maintainability

Iptools

A set of tools that checks and validates ipaddress.

Detect if the ipaddress is valid:

\JorisRos\IpTools::validateIp('192.168.192.13');

Detects if ipaddress is allowed in given range, by a minus sign between two ipadresses:

\JorisRos\IpTools::isIpInRange('192.168.192.13', '192.168.192.12-192.168.192.14');

Detects if ipaddress is allowed in given range, by a wildcard sign:

\JorisRos\IpTools::isIpInRange('192.168.192.13', '192.168.192.*,192.168.192.*');

Detects if ipaddress is allowed in given range, by a subnet:

\JorisRos\IpTools::isIpInRange('192.168.192.13', '192.168.192.0/24');

Installation

Installation can be done by composer

composer require jorisros/iptools

And use the autoloader to load it

<?php
require __DIR__.'/vendor/autoload.php';

$isValid = \JorisRos\IpTools::validateIp('192.168.192.13');

About

A set of tools that checks and validates ipaddress.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages