1. Go to this page and download the library: Download coercive/browser library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Coercive\Utility\Browser
# Load instance
$ip = new Ip();
# Validate ip / cidr
if($ip->check('127.0.0.1')) {}
if($ip->check('127.0.0.1/32', true)) {}
# Cidr in range infos (start, end, subnet, wildcard, count...)
echo '<pre>';
var_dump($ip->cidrToRange('127.0.0.1/32'));
echo '</pre>';
# List all ips in range
echo '<pre>';
var_dump($ip->cidrToFullRange('127.0.0.1/32'));
echo '</pre>';
# Check if IP is in given domain list - with optional reverse check
if($ip->isIpMatchDomains('127.0.0.1', ['example.domain.com'], true)) {}
# Checking if a given ip belongs to given cidr list
if($ip->isInRange('127.0.0.1', ['127.0.0.1/27','127.0.0.1/64'])) {}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.