Skip to content

aheissenberger/php-array-to-json-js

Repository files navigation

PHP Array to JSON/JS

Features

Convert a PHP Array to JSON (requires node and a php runtime)

Installation

npm

npm install php-array-to-json-js

Yarn

yarn install php-array-to-json-js

Requirements

PHP Array to JSON needs to provide an executable php interpreter in the path. Does only work in a nodejs environment as spawn is used to pipe the php array through php json_encode

Usage

ES Modules / ES6

import {phpArray2json} from 'php-array-to-json-js'

const phpArray = '["key"=>[1,"string",,true]]'
const json = phpArray2json(json)
console.log(json) // {"key":[1,"string",,true]}

UMD

const {phpArray2json} = require('php-array-to-json-js')

Roadmap

  • [ ]

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.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Built With

no dependencies

License

Distributed under the "bsd-2-clause" License. See LICENSE.txt for more information.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published