Skip to content

gadnis/valid-url

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Url string parser

This package depends on parse_url, gethostbyname php functions. It provides a simple way to cast all what is needed about url string:

  • Domain
  • Ip
  • Prefix
  • Validation
  • etc.

Getting Started

Install

Run the following command:

composer require edbox/valid-url

Usage

$url = 'https://www.example.com/index.php?request=product_cat&product_info=22726';

$object = new Edbox\Tools\ValidUrl($url);
// or
// $object = (new Edbox\Tools\ValidUrl)->setUrlString($url);
var_dump(

    /**
     * Available get methods
     */
    $object->toArray()
    // $object->getPrefix()
    // $object->getDomain()
    // $object->getUniqDomain()
    // $object->getPath()
    // $object->getQuery()
    // $object->getFragment()
    // $object->getIp()
    // $object->isValid()
);

Credits

License

The MIT License (MIT). Please see LICENSE for more information.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages