Closed sebui closed 1 year ago
Correct there's a mistake in the documentation it should have been instead:
<?php
require_once 'vendor/autoload.php';
use League\Uri\Components\Query;
$query = Query::createFromPairs([
['foo', 'bar'],
['p', 'yolo'],
['z', ''],
]);
echo $query;
I will try to fix it ASAP or you can already submit a PR with the fix.
docs have been fixed
Bug Report
Summary
The example on the documentation does not work (https://uri.thephpleague.com/components/2.0/query). It is not clear what kind of array we should pass to the function. [key => value, key2 => value2 ...] or [[key, value], [key, value]] The first form is more convenient, but does not work.
Standalone code, or other way to reproduce the problem
Expected result
Actual result