{"id":28099138,"url":"https://github.com/technically-php/rack-utils-http-query","last_synced_at":"2025-05-13T17:59:36.861Z","repository":{"id":57066117,"uuid":"72573722","full_name":"technically-php/rack-utils-http-query","owner":"technically-php","description":"Tiny PHP package to build HTTP URL query string compatible with Rails apps","archived":false,"fork":false,"pushed_at":"2016-11-01T20:51:45.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-07T00:40:47.357Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/technically-php.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-01T20:27:09.000Z","updated_at":"2023-03-14T17:09:00.000Z","dependencies_parsed_at":"2022-08-24T14:54:00.162Z","dependency_job_id":null,"html_url":"https://github.com/technically-php/rack-utils-http-query","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technically-php%2Frack-utils-http-query","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technically-php%2Frack-utils-http-query/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technically-php%2Frack-utils-http-query/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technically-php%2Frack-utils-http-query/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/technically-php","download_url":"https://codeload.github.com/technically-php/rack-utils-http-query/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254000308,"owners_count":21997427,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-13T17:59:36.240Z","updated_at":"2025-05-13T17:59:36.852Z","avatar_url":"https://github.com/technically-php.png","language":"PHP","readme":"# RackUtils HTTP query\n\nTiny package to build HTTP URL query string compatible with Rails app.\n\n# Usage\n\nThis library produces output without explicit indices. As simple as that.\n   \n``` php\n$vars = ['fruits' =\u003e ['apple', 'banana', 'orange']];\n$query_string = \\TechnicallyPhp\\RackUtilsHttpQuery::build($vars);\nvar_dump($query_string); \n// will output: \"fruits[]=apple\u0026fruits[]=banana\u0026fruits[]=orange\"\n```\n\n# Motivation\n\nPHP stock [`http_build_query()`](http://php.net/manual/en/function.http-build-query.php) \nconverts array into items with indices explicitly defined. \nThis is not compatible with the way Rails applications parse requests. \n     \n``` php\n$vars = ['fruits' =\u003e ['apple', 'banana', 'orange']];\n$query_string = http_build_query($vars);\nvar_dump($query_string); \n// will output: \"fruits[0]=apple\u0026fruits[1]=banana\u0026fruits[2]=orange\"\n```\n\nRelevant StackOverflow discussions:\n\n1. [php url query nested array with no index](http://stackoverflow.com/questions/11996573/php-url-query-nested-array-with-no-index)\n\n# Details\n\nThis package follows \n`Rack::Utils.parse_nested_query` [specification](https://github.com/rack/rack/blob/master/test/spec_utils.rb).\nPlease check [RackUtilsHttpQueryTest.php](./tests/RackUtilsHttpQueryTest.php#L59).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnically-php%2Frack-utils-http-query","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechnically-php%2Frack-utils-http-query","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnically-php%2Frack-utils-http-query/lists"}