I am using jQueryUI datepicker and making sure that the date, mm/dd/yyyy is shown to the user so they understand what they entered is correct. My only problem is I don’t understand how to then take that date and format it to go into mysql date field correctly?
I am using jQueryUI datepicker and making sure that the date, mm/dd/yyyy is shown
Share
That’s pretty easy if you know a little PHP.
Because PHP being a string manipulation language, it is a must to know some string manipulation basics.
You can use strpos() function to locate position of
/symbol and then use substr() to get numbers and then use.concatenation operator to get date parts in orderYou can use very handy
explode()function, to get date parts into array and then combine them using some variable interpolation, like this:When mastered your string manipulation skills, you can start with real powerful voodoo of regular expressions.