I am trying to write a regex expressions in PHP to validate two variables:
1). $months range from (1 - 31)
2). $days range from (1 - 12)
How could you write that regex expression for each ?
Thanks
I am trying to write a regex expressions in PHP to validate two variables:
1). $months range from (1 - 31)
2). $days range from (1 - 12)
How could you write that regex expression for each ?
Thanks
You would be better off using simple php opperators,e.g.
if( $months > 0 && $months < 32 )
But the issue you will have is some months only have some many days. Use this instead: