Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

urlencode-for-php

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

urlencode-for-php

encode object/array to php-like query string

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
651
decreased by-17.59%
Maintainers
1
Weekly downloads
 
Created
Source

PHP style query string encoder in Node.JS

NPM

npm install urlencode-for-php --save

Usage

var urlencode = require('urlencode-for-php');

var data = {a:[1,2,3,4]};
console.log( urlencode(obj) );
// will output 'a[0]=1&a[1]=2&a[2]=3&a[3]=4'
var obj = 
{
	"a":"b", 
	c: [ 1, 2, 3 ], 
	d:
	[
		{ arr: ["+-X&?",2] },
		{ arr: [3,4] }
	]
};
console.log(urlencode(obj));
// will output: 'a=b&c[0]=1&c[1]=2&c[2]=3&d[0][arr][0]=%2B-X%26%3F&d[0][arr][1]=2&d[1][arr][0]=3&d[1][arr][1]=4'

License

MIT

FAQs

Package last updated on 29 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc