How to get the date format of the user entered date ?

Discussion in 'PHP' started by vaakash, Apr 15, 2010.

  1. #1
    Hello,

    I am currently working in a project based on dates . Users will enter a date and PHP should check the date format entered is YYYY-MM-DD otherwise it should show a error !!

    For example when 24-4-2010 is entered, php should show an error.

    Is there any function for it ?

    Thanks !
     
    vaakash, Apr 15, 2010 IP
  2. Kaimi

    Kaimi Peon

    Messages:
    60
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Kaimi, Apr 15, 2010 IP
  3. aTo

    aTo Active Member

    Messages:
    473
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    78
    #3
    what is the type of the input? int or str?
     
    aTo, Apr 15, 2010 IP