PHP code example of webignition / absolute-url-deriver

1. Go to this page and download the library: Download webignition/absolute-url-deriver 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/ */

    

webignition / absolute-url-deriver example snippets



use webignition\AbsoluteUrlDeriver\AbsoluteUrlDeriver;
use webignition\Uri\Uri;

$base = 'https://example.com';
$relative = '/path?query#fragment';

$this->assertEquals(
    'https://example.com/path?query#fragment', 
    AbsoluteUrlDeriver::derive(new Uri($base), new Uri($relative))
);