How do I compare two dates in PHP?

Faith

New member
I am working on my church's website. They have asked me if it would be possible for me to set it up so the church secretary can type events into a text file, and the home page will read it. I have that working, but I would like it to compare dates, and not show old events. I can get it to read the month day and year all as two digit numbers, and I can get it to check the current month day and year, but I can't seem to get the script to compare them. What I tried was something like:
if($eyear >= $year)
{
other code
}
But this seems to always say that the $eyear, which is the event year, is not greater then or equal to the $year, which is the current year. Can anyone help?
 
Back
Top