srph / qp
This package is abandoned and no longer maintained.
No replacement package was suggested.
A library to parse or stringify query parameters in PHP.
v0.1.0
2015-12-12 06:34 UTC
Requires
- phpunit/phpunit: ^5.1
This package is not auto-updated.
Last update: 2022-02-01 12:53:39 UTC
README
A library to parse or stringify query parameters in PHP.
Deprecation Notice
Use http_build_query
instead. This library doesn't have a valid use case.
Installing
composer require srph/qp
Supports versions >=5.5.9
(including 7.0
).
Usage
use Qp\Qp; Qp::parse('username=kier'); // ['username' => 'kier'] Qp::parse('user[name]=kier'); // ['user' => ['name' => 'kier']]; Qp::parse('users[]=kier'); // ['users' => ['kier']] Qp::stringify(['username' => 'kier', 'password' => '****']); // 'username=kier&password=*****'
Limitations
- Parser does not support nested arrays and objects (https://github.com/srph/qp/issues/1).
I'm short in time at the moment, and I don't see their usage in real world application yet. But if you would like them to be supported (which I would consider rare), feel free to submit a pull request.