News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Will this work?

Started by The Wizard, October 05, 2014, 06:05:25 AM

Previous topic - Next topic

The Wizard

Hello:

I am looking to find out if my understand of the date function is correct with the code below. I am 95% sure it will work, but without waiting days I can't be sure. Can anybody tell me 100% that it is correct and will work?

Thanks

Wiz


$MM=date("m");
$DD=date("d");

// Sunday
if( $MM==10 and $DD<=5 )
{
$episodeA = 'Episode 3';
$episodeB = 'Episode 4';
}
else

// Monday
if( $MM==10 and $DD<=6 )
{
$episodeA = 'Episode 5';
$episodeB = 'Episode 6';
}
else

// Tuesday
if( $MM==10 and $DD<=7 )
{
$episodeA = 'Episode 7';
$episodeB = 'Episode 8';
}
else

//Wensday
if( $MM==10 and $DD<=8 )
{
$episodeA = 'Episode 9';
$episodeB = 'Episode 10';
}

echo $episodeA,'<br /><br />';
echo $episodeB,'<br /><br />';

NanoSector

Uh, that code will work if it's the 10th month for the first 5, 6, 7 or 8 days...

What are you trying to achieve?
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Advertisement: