vbnullchar Posted March 26, 2007 Share Posted March 26, 2007 how can i validate a date with different delimeter? mm/dd/yyyy mm-dd-yyyy Link to comment https://forums.phpfreaks.com/topic/44290-date-validation/ Share on other sites More sharing options...
c4onastick Posted March 26, 2007 Share Posted March 26, 2007 Like this: if( preg_match('%(?:\d{2}[/-]){2}\d{4}%', $date) ) { echo "Date is ok"; } Link to comment https://forums.phpfreaks.com/topic/44290-date-validation/#findComment-215141 Share on other sites More sharing options...
vbnullchar Posted March 26, 2007 Author Share Posted March 26, 2007 cool thanks! Link to comment https://forums.phpfreaks.com/topic/44290-date-validation/#findComment-215158 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.