How to check format of date in php?