2017 © Pedro Peláez
 

library browser

Coercive Utility Browser

image

coercive/browser

Coercive Utility Browser

  • Monday, July 23, 2018
  • by Coercive
  • Repository
  • 1 Watchers
  • 1 Stars
  • 157 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 94 % Grown

The README.md

Coercive Utility Browser

BETA Simple browser detection utility, (*1)

Get

composer require coercive/browser

Basic Browser Options

use Coercive\Utility\Browser

# Load instance
$browser = new Browser();

# Examples
echo $browser->browser()['name']
echo $browser->browser()['version']
echo $browser->os()
echo $browser->getAGENT()
echo $browser->getIP()

if($browser->mobile()) {}

if($browser->isClientIpInRange('range', /* current */)) {}
if($browser->isClientIpInRange('range', 'ip')) {}

# Mobile_Detect
# https://github.com/serbanghita/Mobile-Detect
$oBrowser->Mobile_Detect()

Basic Ip Options

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 '

';
var_dump($ip->cidrToRange('127.0.0.1/32'));
echo '
'; # List all ips in range echo '
';
var_dump($ip->cidrToFullRange('127.0.0.1/32'));
echo '
'; # 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'])) {}

The Versions

23/07 2018

dev-master

9999999-dev http://coercive.fr

Coercive Utility Browser

  Sources   Download

MIT GNU

The Requires

 

23/07 2018

0.0.3

0.0.3.0 http://coercive.fr

Coercive Utility Browser

  Sources   Download

MIT

The Requires

 

07/02 2018

0.0.2

0.0.2.0 http://coercive.fr

Coercive Utility Browser

  Sources   Download

MIT

The Requires

 

19/10 2017

0.0.1

0.0.1.0 http://coercive.fr

Coercive Utility Browser

  Sources   Download

GNU

The Requires