PHP code example of bentools / querystring
1. Go to this page and download the library: Download bentools/querystring 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/ */
bentools / querystring example snippets
use function BenTools\QueryString\query_string;
$qs = query_string(
'foo=bar&baz=bat'
);
$qs = $qs->withParam('foo', 'foofoo')
->withoutParam('baz')
->withParam('ho', 'hi');
print_r($qs->getParams());
/* Array
(
[foo] => foofoo
[ho] => hi
) */
print $qs; // foo=foofoo&ho=hi