PHP code example of vdb / uri

1. Go to this page and download the library: Download vdb/uri 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/ */

    

vdb / uri example snippets


use VDB\Uri\Uri;

$uri = new Uri('http://user:[email protected]/foo/..?bar#baz');

$uri = new Uri('/foo/..?bar#baz', 'http://user:[email protected]?ignored');

$relativeUri = new Uri('/foo/..?bar#baz');

$parsedUriString = $uri->toString(); // 'http://user:[email protected]/?bar#baz'
$parsedRelativeUriString = $relativeUri->toString(); // '/foo/..?bar#baz'

$query = $uri->getQuery(); // 'bar'