fareedreg Posted January 12, 2010 Share Posted January 12, 2010 how can i validate date dd/mm/yyyy. if anyone have js or any php to solve this problem.. please help me out Quote Link to comment https://forums.phpfreaks.com/topic/188158-validate-date-ddmmyyyy/ Share on other sites More sharing options...
Lamez Posted January 12, 2010 Share Posted January 12, 2010 Most people won't help you out here unless you try. Post some code and maybe we can help you. For starters, take a look at http://php.net/date and maybe even http://php.net/if Quote Link to comment https://forums.phpfreaks.com/topic/188158-validate-date-ddmmyyyy/#findComment-993362 Share on other sites More sharing options...
The Little Guy Posted January 12, 2010 Share Posted January 12, 2010 This can add one week: $date = '07/12/2010'; list($d, $m, $y) = explode("/", $date); $newDate = "$y/$m/$d"; echo date("Y/m/d", strtotime($newDate." + 1 week")); Quote Link to comment https://forums.phpfreaks.com/topic/188158-validate-date-ddmmyyyy/#findComment-993374 Share on other sites More sharing options...
Daniel0 Posted January 12, 2010 Share Posted January 12, 2010 Explode the string using explode and then validate it using checkdate. Quote Link to comment https://forums.phpfreaks.com/topic/188158-validate-date-ddmmyyyy/#findComment-993436 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.