Created
September 6, 2015 22:16
-
-
Save vhdm/81a044cf9e5c60a0c3cc to your computer and use it in GitHub Desktop.
Word of the day
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function wordofday(){ | |
$filename = "words.txt"; | |
$handle = fopen($filename, "r"); | |
$contents = fread($handle, filesize($filename)); | |
fclose($handle); | |
$array = explode("\n",$contents); | |
$date = date("z"); | |
if($date > count($array)){ | |
return $array[0]; | |
}else{ | |
return $array[$date]; | |
} | |
} | |
echo '<p> </p><p>'.wordofday().'</p>'; | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Take me out to the ball game | |
Take me out to the park | |
Buy me some peanuts and crackerjacks | |
I don't care if we ever get back | |
Root, root, root for the home team | |
If they don't win its a shame | |
For its one, two, three strikes your out | |
at the old ball game. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment