build-php-query
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

buildPHPQuery

Generate PHP like URL-encoded query string

NPM JavaScript Style Guide

Install

npm install --save build-php-query

Usage

const buildPHPQuery = require('build-php-query')

buildPHPQuery({
  page: 1,
  user: {
    username: 'user1',
    name: 'User 1'
  },
  arrayOfRandomValues: [
    12,
    56,
    78
  ]
})

gives:

'page=1&user[username]=user1&user[name]=User%201&arrayOfRandomValues[]=12&arrayOfRandomValues[]=56&arrayOfRandomValues[]=78'

This also supports nesting.

License

MIT © ArtemGolovko

Readme

Keywords

Package Sidebar

Install

npm i build-php-query

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

3.76 kB

Total Files

4

Last publish

Collaborators

  • artem_golovko