hello...
I am new to php .. and I wanted to make a holidays list...
I want to use a file (XML or TXT) and store the holidays in them and get the php code to display the holidays based on the month....
The only thing is, most likely if I use txt files... I might have to use 12 files ?? 1 for each month...
also .. I need to get 2 pieces of data from each line
example for the month of '12':
24:Christmas Eve
25:Christmas Day
26:Boxing Day
so I need to determine the month, then find the month file.... (any idea?)
and then I add need to the contents to the file... but I need to sort it according to the day... ??
<?php
// Read the entire file into the variable $file_contents
$filename = '/path/to/file.txt';
$fp = fopen( $filename, 'r' );
$file_contents = fread( $fp, filesize( $filename ) );
fclose( $fp );
// Place the individual lines from the file contents into an array.
$lines = explode ( "\n", $file_contents );
// Split each of the lines into a day and a event pair
// and attempt to match them to $PHP_DAY and $PHP_EVENT.
foreach ( $lines as $line ) {
list( $day, $event ) = explode( ':', $line );
// display $day and $event in table
break;
}
}
?>
Reference for the table: http://www.partycaramba.com/shop/index.php?option=com_wrapper&Itemid=40
the purple one on the right under the calendar
any help...