PHP code example of max13 / url-parser

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

    

max13 / url-parser example snippets




use MX\UrlParser\UrlParser;

$p_url = new UrlParser('dev.api.example.co.uk/1/2/3?key=val#anchor');

/*
$p_url->scheme; // === null
$p_url->host; // == 'dev.api.example.co.uk'
$p_url->subdomain; // == 'dev'
$p_url->tld; // == 'co.uk'
*/