2017 © Pedro Peláez
 

library php-array-dumper

Dump an array into XML, JSON, YAML, etc...

image

jfcherng/php-array-dumper

Dump an array into XML, JSON, YAML, etc...

  • Thursday, July 26, 2018
  • by jfcherng
  • Repository
  • 1 Watchers
  • 0 Stars
  • 389 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 17 Versions
  • 0 % Grown

The README.md

php-array-dumper

GitHub Workflow Status (branch) Packagist Packagist Version Project license GitHub stars Donate to this project using Paypal, (*1)

Dump an array into XML, JSON, YAML, etc..., (*2)

Installation

$ composer require jfcherng/php-array-dumper

Example

See demo.php., (*3)

<?php

include __DIR__ . '/vendor/autoload.php';

use Jfcherng\ArrayDumper\DumperFactory;

$array = [
    0 => 'zero',
    '*' => 'bar',
    'deep' => [
        'list' => ['zero', 'one', '二'],
        'map' => ['zero' => 0, 'one' => 1, '二' => 2],
    ],
];

// 'json', 'xml', 'yaml', 'php'
$dumperName = 'yaml';

// initiate a dumper and optionally set its options
$dumper = DumperFactory::make($dumperName, [
    'indent' => 2,
]);

// dump into a string
$string = $dumper->dump($array);

/*
string(83) "0: zero
'*': bar
deep:
  list: [zero, one, 二]
  map: { zero: 0, one: 1, 二: 2 }
"
*/
var_dump($string);

// dump as an external file
$outputFile = __DIR__ . '/results/test.' . $dumper::EXTENSION;
$success = $dumper->toFile($array, $outputFile);

The Versions

26/07 2018

dev-master

9999999-dev

Dump an array into XML, JSON, YAML, etc...

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jack Cherng

json xml yaml

18/07 2018

1.0.5

1.0.5.0

Dump an array into XML, JSON, YAML, etc...

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jack Cherng

json xml yaml

04/07 2018

1.0.4

1.0.4.0

Dump an array into XML, JSON, YAML, etc...

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jack Cherng

json xml yaml

04/07 2018

1.0.3

1.0.3.0

Dump an array into XML, JSON, YAML, etc...

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jack Cherng

json xml yaml

25/06 2018

1.0.2

1.0.2.0

Dump an array into XML, JSON, YAML, etc...

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jack Cherng

25/06 2018

1.0.1

1.0.1.0

Dump an array into XML, JSON, YAML, etc...

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jack Cherng

24/06 2018

1.0.0

1.0.0.0

Dump an array into XML, JSON, YAML, etc...

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jack Cherng

23/06 2018

0.3.1

0.3.1.0

Dump an array into XML, JSON, YAML, etc...

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jack Cherng

23/06 2018

0.3.0

0.3.0.0

Dump an array into XML, JSON, YAML, etc...

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jack Cherng

22/06 2018

0.2.1

0.2.1.0

Dump an array into XML, JSON, YAML, etc...

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jack Cherng

21/06 2018

0.2.0

0.2.0.0

Dump an array into XML, JSON, YAML, etc...

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jack Cherng

21/06 2018

0.1.1

0.1.1.0

Dump an array into XML, JSON, YAML, etc...

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jack Cherng

20/06 2018

0.1.0

0.1.0.0

Dump an array into XML, JSON, YAML, etc...

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jack Cherng

19/06 2018

0.0.4

0.0.4.0

Dump an array into PHP code, JSON, YAML, etc...

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jack Cherng

19/06 2018

0.0.3

0.0.3.0

Dump an array into PHP code, JSON, YAML, etc...

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jack Cherng

19/06 2018

0.0.2

0.0.2.0

Dump an array into PHP code, JSON, YAML, etc...

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jack Cherng

19/06 2018

0.0.1

0.0.1.0

Dump an array into PHP code, JSON, YAML, etc...

  Sources   Download

The Requires

 

The Development Requires

by Jack Cherng