PHP code example of juststeveking / uri-builder

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

    

juststeveking / uri-builder example snippets


[
    "scheme" => "https",
    "host" => "www.domain.com",
    "path" => "/api/v1/resource"
    "query" => "

$url = Uri::build()
           ->addScheme('https')
           ->addHost('www.domain.com')
           ->addPath('api/v1/resource')
           ->addQuery('

$url = Uri::fromString('https://www.domain.com/api/v1/resource?

$url = Uri::build()
           ->addScheme('https')
           ->addHost('www.domain.com')
           ->addPath('api/v1/resource')
           ->addQuery('

$url = Uri::build()
           ->addScheme('https')
           ->addHost('www.domain.com')
           ->addPath('api/v1/resource')
           ->addQuery('

public function addQueryParam(string $key, $value, bool $covertBoolToString = false)

$url = Uri::fromString('https://www.domain.com/api/v1/resource');
$url->addQueryParam('