ensuring a date is not in the past

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

Post Reply
hame22
Forum Contributor
Posts: 214
Joined: Wed May 11, 2005 5:50 am

ensuring a date is not in the past

Post by hame22 »

Hi

I have a form where a user selects a date.

How do I in PHP ensure that this date is not in the past?

Thanks in advance
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

use strtotime() and time() and the greater than operator (>)
Post Reply