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 Quote Link to comment 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"; } Quote Link to comment Share on other sites More sharing options...
vbnullchar Posted March 26, 2007 Author Share Posted March 26, 2007 cool thanks! Quote Link to comment 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.