php - Efficiently change website body depending on day? -


so have website, , have txt file multiple lines date, text. can find how parse txt file text goes date, there way make instead of every person tries load page having server logic , find out text display, make first person per day make server find out text display server automatically displays rest of day?

you can write results file, sort of cache system.

$today = date('y-m-d'); $path = '/path/to/cache/'; $file = $path.$today;  // cache file exist? if not, make if ( ! is_file($file)) {     // parse text file, content, write file     file_put_contents($file, $txt_content); }  $content = file_get_contents($file); 

Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -