crit/domain

This package is abandoned and no longer maintained. No replacement package was suggested.

Domain parsing abstraction

dev-master 2013-12-20 01:09 UTC

This package is not auto-updated.

Last update: 2022-02-01 12:29:21 UTC


README

This is my helper method for dealing with url strings. Specific to a couple of projects I'm working on

Install

Easy install with Composer.

php composer.phar require "crit/domain": "dev-master"

Usage

<?php
include "vendor/autoload.php";

use Domain\Domain;

$local = Domain::isLocal("http://google.com"); // false
$ip = Domain::isIP("http://www.google.com"); // false
$host = Domain::Host("http://www.google.com/search?q=php"); // www.google.com
$sub = Domain::Sub("http://a.www.google.com/"); // www (I only need first sub)
$tld = Domain::TLD("http://www.google.com/search?q=php"); // com
$ident = Domain::Identity("http://www.google.com"); // google.com