0

I'm trying to sanitize a date sent from jquery's datepicker before inserting it into a mysql database but I can't seem to get it to work. Can anyone tell me what I'm doing wrong? Thanks.

//Pull date from datepicker
 $date=$_POST['date'];

//Convert to date for mysql insertion
$mydate = date ("Y-m-d", strtotime($date));

$clean_date = preg_replace("([^0-9/])", "",$mydate);
JulianJ
  • 1,259
  • 3
  • 22
  • 52

0 Answers0