rolfisub/print-key-value

A function to print key values to stdout.

1.0.1 2018-12-30 00:05 UTC

This package is auto-updated.

Last update: 2024-05-21 19:01:59 UTC


README

To install run: composer require rolfisub/print-key-value

To use in your php file

use Rolfisub/PrintKeyValue/PrintKeyValue;

$pkv = new PrintKeyValue();

echo $pkv->printKeyValues([
    1,
    2,
    3,
    4,
    "some"=>"array",
    [
        1,
        [
            "yey"=>"value"
        ]
    ]
]);

/*this will output:

0:1
1:2
2:3
3:4
some:array
{
 0:1
 {
  yey:value
 }
}

Output can be customized using the constructor parameters. Please check the class constructor as a reference.

Additionally you can call the clear() method to reset the output to "".