This question already has an answer here:
In PHP, I have a string that I need to check if it is the following format:
XXXX-YY-ZZ
Where x,y and z are integers. So the string contains 3 integers separated by 2 dashes with the following rules:
xxxx > 2003
yy >= 0 and yy <= 12
zz >= 1 zz <= 31
What would be the easiest way to validate this?
</div>