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

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -