PHP code example of alexkratky / url
1. Go to this page and download the library: Download alexkratky/url library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
alexkratky / url example snippets
lexKratky\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";
}