PHP code example of ailixter / gears-url
1. Go to this page and download the library: Download ailixter/gears-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/ */
ailixter / gears-url example snippets
php
$url = new URL('http://httpbin.org/get');
$url->setQueryParam('p', 'test');
echo $url->path;
print_r($url->query);
$url->path = 'post';
echo $url;
php
echo (new URL)
->setScheme('http')
->setHost('httpbin.org')
->setQuery(['p' -> 'test'])
;