By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,637 Members | 3,079 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,637 IT Pros & Developers. It's quick & easy.

days till today function ?

P: n/a
Need function thath will list all days till today in current month...
TNX..
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
..:DeVa:. ( ) wrote:
Need function thath will list all days till today in current month...


function list_days() {
for ($i = 1; $i <= date('d'); ++$i) {
echo $i, "<br/>\n";
}
}

--
USENET would be a better place if everybody read: : mail address :
http://www.catb.org/~esr/faqs/smart-questions.html : is valid for :
http://www.netmeister.org/news/learn2quote2.html : "text/plain" :
http://www.expita.com/nomime.html : to 10K bytes :
Jul 17 '05 #2

P: n/a
Pedro Graca scribbled something along the lines of:
.:DeVa:. ( ) wrote:
Need function thath will list all days till today in current month...

function list_days() {
for ($i = 1; $i <= date('d'); ++$i) {
echo $i, "<br/>\n";
}
}


Note that this won't work if for some reason a day is being skipped
(which happend when our modern calendar was introduced a couple of
centuries ago). Not a likely case in the Real World (tm), but still...

--
Alan Plum, WAD/WD, Mushroom Cloud Productions
http://www.mushroom-cloud.com/
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.