• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

PHP Coding Question

Chimpie

Well-known member
#1
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!
 

Chimpie

Well-known member
#5
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';
}

?>
 

Jake Bunce

XenForo moderator
Staff member
#6
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';
}

?>