Want to include a php script to generate a new word every new day.
Is this the correct way to do it?
<?php
$file = fopen("interesting_words.txt","r");
$raw_string = fread($file,filesize("interesting_words.txt"));
fclose($file);
$words_array = explode("|",$raw_string);
echo $words_array[array_rand($words_array)];
srand(date("ymd"));
?>
My doubts is with the srand date format. Maybe I am wrong somewhere as it doesn’t change.
By the way, I wonder if the issue has to do with my location. I am in Spain, i.e. GMT +1
Any comment or help will be much appreciated.
Thanks
Mario Hussein