One last question:
<?php
putenv("TZ=America/Vancouver");
$alarms = array(
0=>array('date'=>'', 'day'=>'3', 'hour'=>'', 'min'=>'', 'msg'=>'<img src="http://freepgs.com/neoaddictboards/buttons.png" alt="" /><br /><font face="Verdana" size="2" color="red">The <a href="http://www.neopets.com/winter/snowager.phtml" target="_blank">Snowager</a> is asleep!</font>'),
1=>array('date'=>'Wed', 'day'=>'', 'hour'=>'7', 'min'=>'', 'msg'=>'<img src="http://freepgs.com/neoaddictboards/buttons.png" alt="" /><br /><font face="Verdana" size="2" color="grey">Drop by the <a href="http://www.neopets.com/donations.phtml" target="_blank">Money Tree</a> for Balthazars Faerie Giveaway!</font>'),
2=>array('date'=>'Sun', 'day'=>'', 'hour'=>'5', 'min'=>'50', 'msg'=>'<img src="http://freepgs.com/neoaddictboards/buttons.png" alt="" /><br /><font face="Verdana" size="2" color="purple">Drop by the <a href="http://www.neopets.com/donations.phtml" target="_blank">Money Tree</a> for Balthazars Faerie Giveaway!</font>'),
3=>array('date'=>'', 'day'=>'', 'hour'=>'7', 'min'=>'', 'msg'=>'<img src="http://freepgs.com/neoaddictboards/buttons.png" alt="" /><br /><font face="Verdana" size="2" color="teal">Drop by the <a href="http://www.neopets.com/donations.phtml" target="_blank">Money Tree</a> for the Health Food Giveaway!</font>'),
4=>array('date'=>'', 'day'=>'', 'hour'=>'0', 'min'=>'', 'msg'=>'<img src="http://freepgs.com/neoaddictboards/buttons.png" alt="" /><br /><font face="Verdana" size="2" color="darkkhaki">Hurry! Go to <a href="http://www.neopets.com/worlds/deadlydice.phtml" target="_blank">Deadly Dice</a> before you miss your chance!</font>'),
5=>array('date'=>'Mon', 'day'=>'', 'hour'=>'10', 'min'=>'45', 'msg'=>'<img src="http://freepgs.com/neoaddictboards/buttons.png" alt="" /><br /><font face="Verdana" size="2" color="darkkhaki">Drop by the <a href="http://www.neopets.com/donations.phtml" target="_blank">Money Tree</a> for Muntando Fruit!</font>'),
6=>array('date'=>'Mon', 'day'=>'', 'hour'=>'22', 'min'=>'45', 'msg'=>'<img src="http://freepgs.com/neoaddictboards/buttons.png" alt="" /><br /><font face="Verdana" size="2" color="darkkhaki">Drop by the <a href="http://www.neopets.com/donations.phtml" target="_blank">Money Tree</a> for Muntando Fruit!</font>'),
7=>array('date'=>'', 'day'=>'', 'hour'=>'6', 'min'=>'', 'msg'=>'<img src="http://freepgs.com/neoaddictboards/buttons.png" alt="" /><br /><font face="Verdana" size="2" color="red">The <a href="http://www.neopets.com/winter/snowager.phtml" target="_blank">Snowager</a> is asleep!</font>'),
8=>array('date'=>'', 'day'=>'', 'hour'=>'14', 'min'=>'', 'msg'=>'<img src="http://freepgs.com/neoaddictboards/buttons.png" alt="" /><br /><font face="Verdana" size="2" color="red">The <a href="http://www.neopets.com/winter/snowager.phtml" target="_blank">Snowager</a> is asleep!</font>'),
9=>array('date'=>'', 'day'=>'', 'hour'=>'22', 'min'=>'', 'msg'=>'<img src="http://freepgs.com/neoaddictboards/buttons.png" alt="" /><br /><font face="Verdana" size="2" color="red">The <a href="http://www.neopets.com/winter/snowager.phtml" target="_blank">Snowager</a> is asleep!</font>')
);
// add each alarm in same format as others above....
// Day: three-letter representation: Sun, Mon, Tue, Wed, Thu, Fri, Sat
// Hour: numerical rep of 24 hour format (no leading zeros): 0 - 24
// msg: The alarm message you want displayed
// A variable to hold our alarms output:
$message = ''; // Set this as an empty string by default!
// Now, to display them, do a simple loop and see if the current hour (date('G'))
// is equal to the alarm hour ($alarms[$i]['hour']). If so, add it to the $message
// otherwise, don't add anything, and continue.
foreach($alarms as $alarm)
{
// Is today the same for the day of the current alarm?
if(date('D') == $alarm['date'])
{
if(date('j') == $alarm['day'])
{
// Okay, so it's the same day, how about hour?
if(date('H') == $alarm['hour'])
{
if(date('m') == $alarm['min'])
{
// Same hour and day, must mean the alarm is active!!
$message .= $alarm['msg'];
$message .= '<br /><br />'; // Add a line-break....
}
}
}
}
}
// So now we've got a populated $message variable. But what about if no
// alarms are active? Then $message would be empty.....
if(empty($message))
{
// If the $message var is empty (it's default value),
// write a default "No Alarms" message
$message = '<font face="Verdana" size="2" color="maroon">No Neopets Alarms right now!</font>';
}
// Now all we need to do is display the message:
echo $message;
?>
I added a few extra array keys, but for some of them, I don't have any values for them because I don't know the exact week of the day that the third is going to occur on, etc