I was using PHP’s date_diff() function to compare 2 dates. I wanted to make sure that a date that the user selected was at least one day away from today. The issue was that for “today” I was using: And comparing this against the user inputted date. When I compared “today” vs “tomorrow,” it said that there were 0 days.

The solution was to change it to this:
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners