PHP code example of fyre / uri

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

    

fyre / uri example snippets


use Fyre\Http\Uri;

$uri = new Uri($uriString);

$uri = Uri::fromString($uriString);

$newUri = $uri->addQuery($key, $value);

$newUri = $uri->exceptQuery($keys);

$authority = $uri->getAuthority();

$fragment = $uri->getFragment();

$host = $uri->getHost();

$path = $uri->getPath();

$port = $uri->getPort();

$query = $uri->getQuery();

$query = $uri->getQueryString();

$scheme = $uri->getScheme();

$part = $uri->getSegment($segment);

$segments = $uri->getSegments();

$segmentCount = $uri->getTotalSegments();

$uriString = $uri->getUri();

$userInfo = $uri->getUserInfo();

$newUri = $uri->onlyQuery($keys);

$newUri = $uri->setAuthority($authority);

$newUri = $uri->setFragment($fragment);

$newUri = $uri->setHost($host);

$newUri = $uri->setPath($path);

$newUri = $uri->setPort($port);

$newUri = $uri->setQuery($query);

$newUri = $uri->setQueryString($query);

$newUri = $uri->setScheme($scheme);

$newUri = $uri->setUserInfo($username, $password);