php - Check for Date in String - jQuery? -
OK, this can be a crazy question and it's not easy to do this, but what I'm trying to do here
I have a textera on a ToD list application that I have created where users add tasks can add jobs without going to work in the work form and adding all the details (when they are too busy). I want to be able to search for that text to see if there is a date there. If it makes it easy, then I can only search for dates in YYYY-MM-DD or similar format. For example, if they are written in their text:
"i need to have my graduation party plan till 2014-05-07" i "database in my area" 2014-05- 07 "Want to move in the part and want to move on to the whole string for a different area? How can I do this? Any ideas on how I can do this? I am using PHP, jQuery and MySQL, so if any other language I have a way to do this, so I
Use preg_match () to extract the date string. Then match the matches separately Archive
& lt ;? php $ str = 'I need to plan my graduation party till 2014-05-07; if (preg_match (' @ / ([0-9 ] {4} - [0-9] {2} - [0-9] {2}) / @ ', $ str, $ match) var_dump ($ matches [1]);
Comments
Post a Comment