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,eg
if( $months > 0 && $months < 32 )
But the issue you will have is some months only have some many days. Use this instead:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.