1. Go to this page and download the library: Download dealnews/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/ */
dealnews / url example snippets
use DealNews\Url\Url;
$url = new Url('https://user:[email protected]:443/products/tv?q=4k#details');
$url->normalize(); // lowercases scheme/host and sorts query parameters
$url->query_string->setParameter('page', '2');
$url->fragment = 'reviews';
echo $url->build(); // https://user:[email protected]/products/tv?q=4k&page=2#reviews
// Merge additional data without losing the existing state
$combined = $url->merge('http://cdn.example.com/media', '?size=large');
// $combined => http://cdn.example.com/media?size=large
// $url remains unchanged
use DealNews\Url\QueryString;
$qs = new QueryString('foo=1&bar=2');
$qs->setParameter('foo', '3');
$qs->addParameter(null, 'feature'); // unnamed flag
$qs->sortParameters(); // only sorts when all params are named
echo $qs->build(); // foo=3&bar=2&feature