Skip to content

Export array as a formatted string, safe to save as a file

License

Notifications You must be signed in to change notification settings

djeux/array-export

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Array export

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',
];
*/

About

Export array as a formatted string, safe to save as a file

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages