PHP Coding Question

Chimpie

Well-known member
I'll freely admit I have no idea how to code this, so feel free to laugh at me before responding. :)

I want text "ABC" to show before a certain date, and text "DEF" to show up after that date.

Thanks!
 
So is this correct, or should I use 'elseif' for the two middle 'if's?
Code:
<?php

if (time() < strtotime('2011-07-24 00:00:00'))
{
echo 'ABC';
}
if (time() > strtotime('2011-07-24 00:00:01'))
if (time() < strtotime('2011-07-26 00:00:00'))
{
echo 'Between';
}
else
{
echo 'DEF';
}

?>
 
Code:
<?php

if (time() < strtotime('2011-07-24 00:00:00'))
{
	echo 'ABC';
}
else if (time() < strtotime('2011-07-26 00:00:00'))
{
	echo 'BETWEEN';
}
else
{
	echo 'DEF';
}

?>
 
Top Bottom