X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=basics.php;h=4e1da442c27d93f42a9305afda42430f66b529ce;hb=ea730f77dfd663624009b6b0d916a690333d9652;hp=72a33a318307c5ba5417efdbc9634c7ba7a61306;hpb=5253f43e816e213374ee0f453ab1905e9cf663f4;p=wfpl.git diff --git a/basics.php b/basics.php index 72a33a3..4e1da44 100644 --- a/basics.php +++ b/basics.php @@ -5,9 +5,9 @@ function read_whole_file($name) { if($fd === false) { die("Failed to read file: '$name'"); } - $temp = fread($fd, filesize($name)); + $file_data = fread($fd, filesize($name)); fclose($fd); - return $temp; + return $file_data; } function unix_newlines($str) { @@ -15,5 +15,14 @@ function unix_newlines($str) { return str_replace("\r", "\n", $str); } +# return current year (all 4 digits) +function this_year() { + return strftime('%Y'); +} + +# return the number of the current month (1..12) +function this_month() { + return strftime('%m'); +} ?>