alexkratky / url
Class to easy work with URI, getting its part etc.
v1.0.0
2020-05-14 09:13 UTC
Requires
- php: >=7.0
This package is auto-updated.
Last update: 2024-10-14 19:30:26 UTC
README
PHP Class to easy work with URI, getting its part etc.
<?php require 'vendor/autoload.php'; use AlexKratky\URL; // e.g. visiting https://panx.eu/docs/v0.2.4/getting-started/ $url = new URL(); $url->getString(); // /docs/v0.2.4/getting-started $url->getElements(); // [0] => '', [1] => 'docs', [2] => 'v0.2.4', [3] => 'getting-started' $url->getCount(); // 3 foreach($url->getLink() as $v) { echo $v . "\n"; }
Prints:
docs
v0.2.4
getting-started