php-array-from-json-js
v0.0.9
Published
Create PHP Array from JSON or Javascript Object Notation Code.
Downloads
3
Maintainers
Readme
PHP Array from JSON/JS
Create PHP Array from JSON or JavaScript object notation Code.
Installation
npm
npm install php-array-from-json-js
Yarn
yarn install php-array-from-json-js
Usage
ES Modules / ES6
import {json2phpArray,js2phpArray} from 'php-array-from-json-js'
const json = '{"key":[1,"string",true]}'
const phparray = json2phpArray(json)
console.log(phparray) // ["key"=>[1,"string",true]]
const js = '{key:[1,"string",null,,true]}'
const phparray = js2phpArray(js)
console.log(phparray) // ["key"=>[1,"string",null,null,true]]
UMD
const {json2phpArray} = require('php-array-from-json-js')
Roadmap
- [ ] support for function output in
js2phpArray
- [ ] options to ignore errors from not supported types
Contribution
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (git checkout -b feature/AmazingFeature)
- Commit your Changes (git commit -m 'Add some AmazingFeature')
- Push to the Branch (git push origin feature/AmazingFeature)
- Open a Pull Request
Built With
no dependencies
development with Vitejs is based on this documentation
License
Distributed under the "bsd-2-clause" License. See LICENSE.txt for more information.