Download the PHP package laktak/hjson without Composer
On this page you can find all versions of the php package laktak/hjson. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Vendor laktak
Package hjson
Short Description JSON for Humans. A configuration file format with relaxed syntax, fewer mistakes and more comments.
License MIT
Homepage https://github.com/hjson/hjson-php
Package hjson
Short Description JSON for Humans. A configuration file format with relaxed syntax, fewer mistakes and more comments.
License MIT
Homepage https://github.com/hjson/hjson-php
Please rate this library. Is it a good library?
Informations about the package hjson
hjson-php
Hjson, the Human JSON. A configuration file format for humans. Relaxed syntax, fewer mistakes, more comments.
The PHP implementation of Hjson is based on hjson-js. For other platforms see hjson.github.io.
Install from composer
Usage
API
HJSONParser: parse($text, $options)
This method parses JSON or Hjson text to produce an object or array.
- text: the string to parse as JSON or Hjson
- options: array
- keepWsc: boolean, keep white space and comments. This is useful if you want to edit an hjson file and save it while preserving comments (default false)
- assoc: boolean, return associative array instead of object (default false)
HJSONStringifier: stringify($value, $options)
This method produces Hjson text from a value.
- value: any value, usually an object or array.
- options: array
- keepWsc: boolean, keep white space. See parse.
- bracesSameLine: boolean, makes braces appear on the same line as the key name. Default false.
- quotes: string, controls how strings are displayed.
- "min": no quotes whenever possible (default)
- "always": always use quotes
- space: specifies the indentation of nested structures. If it is a number, it will specify the number of spaces to indent at each level. If it is a string (such as '\t' or ' '), it contains the characters used to indent at each level.
- eol: specifies the EOL sequence
modify & keep comments
You can modify a Hjson file and keep the whitespace & comments intact. This is useful if an app updates its config file.
History
All versions of hjson with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.6
ext-mbstring Version *
ext-mbstring Version *
The package laktak/hjson contains the following files
Loading the files please wait ....