Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8737275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:29:04+00:00 2026-06-13T10:29:04+00:00

Im having difficulties figuring out how to do the following preg_match in php. I

  • 0

Im having difficulties figuring out how to do the following preg_match in php.
I have a HTML form where the user can enter his or hers birthdate by day, month & year.

How do i validate the following
Day: make sure it’s a number between 1 and 31, actually between 01 and 31
Month: make sure it’s a number between 1 and 12, actually between 01 and 12
Year: make sure it’s a number between 1800 and 2012, actually between 1800 and 2012

if (preg_match( ????? )) {
     echo " SUCCESS";
} else { 
     echo " ERROR";
} 

Thanks…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T10:29:05+00:00Added an answer on June 13, 2026 at 10:29 am

    Checkdate needs 3 different parameters, for validating one input with preg_match, use pattern:

    (0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.]((?|19|20)\d\d)
    

    it validates correct date in style dd-mm-yyy and dd.mm.yyyy and dd/mm/yyyy and if you want, it also parses values out for each parameter

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having difficulties returning a user input string. If I have a code: System.out.println(please
I am having difficulties figuring this out. I can see I am posting XML
I'm having difficulties figuring out how to do the following. Given the following classes:
I have a friend whose having difficulties figuring out how to display a DateTime
I am having difficulties figuring out if APPFabric caching or SQL Server should be
im having difficulties figuring this out, ive looked at examples here and on the
I am having some difficulties figuring out this SQL statement. Here is the schema
I am having difficulties figuring out what is causing wierd characters to appear in
I having difficulties setting my footer properly. I have a Bottom navigation bar as
I am having difficulties achieving Css 100% so my website can look right in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.