PHP code example of thomas-squall / file-utils

1. Go to this page and download the library: Download thomas-squall/file-utils 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/ */

    

thomas-squall / file-utils example snippets

 php
function callback($file) {
    echo "file $file has been loaded..." . EOF;
}

 php
function callback($file) {
    echo "file $file has been loaded..." . EOF;
}

 php
function callback($file) {
    echo "file $file has been loaded..." . EOF;
}

 php
function callback($file) {
    echo "file $file has been loaded..." . EOF;
}

 php
$my_array = [
    'fruit_1' => 'apple',
    'fruit_2' => 'pear',
    'fruit_3' => 'orange' 
];

file_put_json("my/dir/my_file.json", $my_array);