djeux / array-export
Export array as a formatted string, safe to save as a file
dev-master
2020-06-19 17:35 UTC
Requires
- php: ^7.1
Requires (Dev)
- phpunit/phpunit: ^7.0
- symplify/easy-coding-standard: ^6.1
This package is auto-updated.
Last update: 2024-12-30 02:30:03 UTC
README
Export an array as a string that can be later saved as a file with proper formatting.
As a replacement for var_export
, supports defining custom indentation size and character.
Usage:
<?php use Djeux\ArrayExport\Export; $array = [ 'one' => 'String', 'two' => 'String', ]; $asString = Export::make()->export($array); /** [ 'one' => 'String', 'two' => 'String', ] */ $asFile = Export::make()->asFile($array); /** <?php return [ 'one' => 'String', 'two' => 'String', ]; */