I want validate time in format Y-m-d to save it in my db. I tried my codes below, and I get stuck on it.

Code:
 $date = mysql_real_escape_string (strtolower($_POST['date']))."<br/>";
 $format = date('Y-m-d', strtotime('$date'));
  if ($format == TRUE) { echo 'yes'; }  else{ echo 'no'; }
BTW, when the user type the word 'today', it will automatically refer to the current date in the same format and I got it working, now I'm having trouble for combining the validation above. here is my code
Code:
if ($date == 'today') {
echo date("Y-m-d");
}

Thank you in advance!