PHP code example of mjohann / data-manager
1. Go to this page and download the library: Download mjohann/data-manager library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mjohann / data-manager example snippets
MJohann\Packlib\DataManager;
// Create a new folder named "my_dir"
DataManager::folderCreate("my_dir");
// Create a new file "file.txt" inside "my_dir" and write "Test DataManager" to it
DataManager::fileCreate("my_dir/file.txt", "Test DataManager");
// Read the contents of "my_dir/file.txt" and print it
echo DataManager::fileRead("my_dir/file.txt"), PHP_EOL;
// Get and print the size of the "my_dir" folder
echo DataManager::size("my_dir/"), PHP_EOL;
// Scan the "my_dir" folder and print its contents as an array
var_export(DataManager::folderScan("my_dir/"));
data-manager/
├── src/
│ └── DataManager.php
├── example/
│ └── script.php
├── composer.json
├── .gitignore
├── LICENSE
└── README.md