Global data type parser
Via Composer
$ composer require masnathan/parser
use MASNathan\Parser\Parser;
$data = array(
'foo' => 'bar',
'sup' => 'World'
);
$content = Parser::data($data);
$content->setPrettyOutput(true);
echo $content->to('json'); // outputs in json format
echo $content->to('xml'); // outputs in xml format
And also...
$content = Parser::file('path/to/my/file.json')->from('json');
echo $content->to('xml'); // outputs in xml format
// or
echo Parser::file('path/to/my/file.xml')
->from('xml')
->setPrettyOutput(true)
->to('yaml');
Please see CHANGELOG for more information what has changed recently.
$ composer test
Please see CONTRIBUTING for details.
If you discover any security related issues, please email andre.r.flip@gmail.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.