PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
hoopz
Forum Newbie
Posts: 2 Joined: Sun Jul 31, 2005 4:26 am
Post
by hoopz » Mon Jan 30, 2006 5:32 pm
I have the following:
and I wanted to assign $day a default value by doing the following:
Code: Select all
function which_day($day = date("d")) {
}
But it doesn't work. Am I just S.O.L.? or is there an alternate option?
Thanks for your time,
Hoopz
sheila
Forum Commoner
Posts: 98 Joined: Mon Sep 05, 2005 9:52 pm
Location: Texas
Post
by sheila » Mon Jan 30, 2006 5:38 pm
How about this for a work around?
Code: Select all
function which_day($day = -1) {
if ($day == -1) {
$day = date("d");
}
}
hoopz
Forum Newbie
Posts: 2 Joined: Sun Jul 31, 2005 4:26 am
Post
by hoopz » Mon Jan 30, 2006 5:43 pm
oh! hey! that's great. Thanks so much!
Hoopz