PHP code example of teedmakerphp / files
1. Go to this page and download the library: Download teedmakerphp/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/ */
teedmakerphp / 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!
}