Php Date() help
Moderator: General Moderators
Php Date() help
hi there, i wonder if there is any date() function i can use to test if two date ( in the same format) are equal? cheers!
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Even easier:
Note that if they are non-numeric (ignoring symbols) or not in uniform dimensions (04 vs 4) You will get errors. If they vary, you need to convert them to unix timestamps.
Code: Select all
$foo == $bar;hi feyd..thanks for your reply
if given two day
is that what u mean?
i try that but it didn't work...
i am thinking if i should cast those two days to "String" and compare them..
if given two day
Code: Select all
$day1=date("l d M",strtotime("+1 day")); // its in the format like this -- Friday 21 Apr
$day2=date("l d M",strtotime("+2 day"));
if($day1==$day2){
some codes here..
}is that what u mean?
i try that but it didn't work...
i am thinking if i should cast those two days to "String" and compare them..