Skip to content

ayushchd/php-toml-encoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

PHP TOML Encoder

PHP encoder for Tom's Obvious, Minimal Language (TOML) ( https://github.com/mojombo/toml )

Usage

require("../src/toml.php");

$arr = array (
	'a' => 1,
	'b' => array (1, 2, 3),
	'c' => array ('x' => 'apple', 'y' => array(4, 5, 6)),
	'd' => true
	);

$encoder = new Toml_Encoder();
echo $encoder->encode($arr);

Contribute

TOML specs are still changing so if there is something that has been added and/or I have missed, feel free to send me a pull request

TODO

  • Throw exceptions when invalid arrays are passed (e.g. arrays with mixed data types)
  • Test

License

MIT

About

PHP script that encodes an array into valid TOML

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages