djthossi / url-parser
A small lean self written URL parser which parsed a given URL into a OOP version
1.2.0
2019-06-17 09:21 UTC
Requires
- php: >=7.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.15
- phpunit/phpunit: ~8.1
This package is auto-updated.
Last update: 2025-04-17 22:44:57 UTC
README
This URL parser works currenlty only for http and https. If you required // or other protocols, feel free to add them.
How to install
You have several options to install this package
Composer
composer require djthossi/url-parser
Git
git clone https://github.com/DjThossi/url-parser.git
Download
https://github.com/DjThossi/url-parser/archive/master.zip
Example
use DjThossi\UrlParser\ParsedUrl; use DjThossi\UrlParser\UrlParser; class SomeClass { public function parseUrl(string $url): ParsedUrl { $urlParser = new UrlParser(); return $urlParser->parseUrl($url); } }