I have a problem. I've a date input on my site. When the input type date is not supported by the browser, I'm initializing a jQuery datepicker.
The problem is, that the normal date input returns the value like this:
2019-08-23
And the datepicker this way:
26.08.2019
Instead adding a hidden field in the HTML, I want to re-format the received value via PHP to the first format above. So is there a way to build a small function that checks if the format is the datepicker format and which returns the formatted value like 2019-08-26
?
I'm receiving the value with $_POST['date']
.