This repository was archived by the owner on Jan 31, 2025. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork0
Tiny PHP package to build HTTP URL query string compatible with Rails apps
License
NotificationsYou must be signed in to change notification settings
technically-php/rack-utils-http-query
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Tiny package to build HTTP URL query string compatible with Rails app.
This library produces output without explicit indices. As simple as that.
$vars = ['fruits' => ['apple','banana','orange']];$query_string = \TechnicallyPhp\RackUtilsHttpQuery::build($vars);var_dump($query_string);// will output: "fruits[]=apple&fruits[]=banana&fruits[]=orange"
PHP stockhttp_build_query()converts array into items with indices explicitly defined.This is not compatible with the way Rails applications parse requests.
$vars = ['fruits' => ['apple','banana','orange']];$query_string =http_build_query($vars);var_dump($query_string);// will output: "fruits[0]=apple&fruits[1]=banana&fruits[2]=orange"
Relevant StackOverflow discussions:
This package followsRack::Utils.parse_nested_queryspecification.Please checkRackUtilsHttpQueryTest.php.
About
Tiny PHP package to build HTTP URL query string compatible with Rails apps
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.