3 function read_whole_file($name) {
4 $fd = fopen($name, 'r');
6 die("Failed to read file: '$name'");
8 $file_data = fread($fd, filesize($name));
13 function unix_newlines($str) {
14 $str = str_replace("\r\n", "\n", $str);
15 return str_replace("\r", "\n", $str);
18 # return current year (all 4 digits)
19 function this_year() {
20 return strftime('%Y');
23 # return the number of the current month (1..12)
24 function this_month() {
25 return strftime('%m');