rolfisub/print-key-value

一个将键值打印到标准输出的函数。

1.0.1 2018-12-30 00:05 UTC

This package is auto-updated.

Last update: 2024-09-21 19:42:27 UTC


README

要安装,请运行:composer require rolfisub/print-key-value

在你的php文件中使用

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
 }
}

可以使用构造函数参数自定义输出。请参考类构造函数。

此外,您可以调用clear()方法将输出重置为""。