Hi
Is it possible to use php to display different text each day for my website.

Recommended Answers

All 3 Replies

Yes it is. Using the date() function you can find which day of the week it is and base your content on that.

As stymiee said, you can do it. For example something like this:

<?php

	$d = date('w');

	$maxim[] = 'sunday';
	$maxim[] = 'monday';
	$maxim[] = 'tuesday';
	$maxim[] = 'wednesday';
	$maxim[] = 'thursday';
	$maxim[] = 'friday';
	$maxim[] = 'saturday';

	echo $maxim[$d];

?>

Just replace 'sunday, monday...' with your text.
Bye :)

Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.