PHP code example of derhasi / tempdirectory

1. Go to this page and download the library: Download derhasi/tempdirectory 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/ */

    

derhasi / tempdirectory example snippets



$workingDirectory = new TempDirectory('path-preserver-test-working');
// Create directory to test.
$folder1 = $this->workingDirectory->getPath('folder1');
mkdir($folder1);
$file1 = $this->workingDirectory->getPath('file1.txt');
file_put_contents($file1, 'Test content');