Validate Date Format in Php

In this post you will see how to validate date format in php. You can use this validation before inserting it in database which always needs correct formatted date format. Database accepted Format is YYYY-MM-DD.

Use below function to validate the correct format