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.
Run the following command:
composer require edbox/valid-url
$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()
);
The MIT License (MIT). Please see LICENSE for more information.