PHP function validateDate : validate user input

   * This PHP function will convert any user entered date into any formatted date you want.
   * in addition it will validate the user input for data integrity and prevent SQL injection.
   * It accepts almost any date input.
   * As you can see from the below, this is extremely versatile, although it has a few quirks.
   * See additional notes for the quirks or test the code yourself.

User Entry           -->>          Function Output

January 1st 2014                  01/01/14
1st January 2014                  01/01/14
01-01-14                          01/14/01
01.01.2014                        01/01/14
01/01.2014                        01/01/14
01/01                             01/01/14 (month/day this year)
05/05                             05/05/14 (month/day this year)
January                           01/06/14 (today’s day in the month typed)
01.01.14                          06/06/14 (today)
2014                              06/06/14 (today)
01/01.14                          Error Message
2014 January 1st                  Error Message
Ryan Harmon                       Error Message