PHP code example of innmind / url
1. Go to this page and download the library: Download innmind/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/ */
innmind / url example snippets
use Innmind\Url\Url;
$url = Url::of('http://example.com:8080/some/dir/?limit=10');
$url->scheme(); // Scheme('http')
$url->authority()->userInformation()->user(); // User::none()
$url->authority()->userInformation()->password(); // Password::none()
$url->authority()->host(); // Host('example.com')
$url->authority()->port(); // Port(8080)
$url->path(); // Path('/some/dir/')
$url->query(); // Query('limit=10')
$url->fragment() // Fragment::none()