open-api-tools/query-parser

Query string parser with open-api format support

v1.0.0 2021-07-31 08:52 UTC

This package is not auto-updated.

Last update: 2024-11-17 22:36:13 UTC


README

the standard PHP function parse_str() function replaces the same parameter names in the query string. To get an array, you need to add [] to the parameter name, which is not in accordance with the Open-API specification.

This library solves the indicated problem.

$parser = new \OpenApiTools\QueryParser\OpenApiQueryParser();
$parser->parse('id=1&id=2&id=3');

// returns
[
  'id' => [
    '1',
    '2',
    '3',
  ],
];