I'm trying to check a string to make sure it's 7-20 characters in length with at least one numerical character.
This is what i'm using.
$var = 'somenumber';
eregi('^([0-9]+|.){7,20}$', $var)
The problem with this is that numerical character can be absent and this still be true.
Any suggestions on how i'd do this so that the numerical character has to be present in the string.