PHP code example of teedmaker / tmphp-files

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

    

teedmaker / tmphp-files example snippets


$file = new TMPHPFile('path/to/file.txt');
$file->increments("\n Hello new line!");

$file = new TMPHPFile('path/to/file.txt');
$modifiedAt = $file->getMTime();
if($modifiedAt > $timeForDatabase) {
    // then do it
}

$original = new TMPHPFile('path/to/original.txt');
$cached   = new TMPHPFile('path/to/cached.txt');
if($original->modified()->isGreaterThan($cached)) {
    // cache the original again, cause he is old!
}