View Full Version : Script Help

08-28-2011, 01:38 PM
Hi, I am looking to create a script in PHP that automatically changes text once a month so for example in December I want a certain bit of text to show and in January Another. Hope that makes sense

Thanks in advance

08-28-2011, 04:40 PM
Try this.

echo $text[$month];

08-28-2011, 06:30 PM
The only thing I'd change from the above is I'd use n instead of m (btw you'll have an undefined constant from the m in there jh).

$text = array(
1 => 'Text for january',
2 => 'Text for february',

print $text[date('n')];

08-28-2011, 07:25 PM
Ooops missed that. Thanks

09-02-2011, 12:58 PM
Thank you for the replys but dont think I described it to well, what I need is something that in july will say for example its hot and in december for example say its cold and have these automatically change at the beginning of every month

09-02-2011, 01:17 PM
What Fou-Lu posted will do exactly that. Whatever text you put in the array for each month will be displayed for that month and change on the first of every month.