i am trying to build a very simple regex and i am not sure what i am doing wrong. what i want it to do is check a variable to make sure it is all numbers. so this is the best i have come up with:
ereg("([A-Z|a-z])", $var);
so it checks for letters and if it's true i kill the script or false it continues. the problem is that there are other characters that could be entered. i have tried to make a regex that matches just numbers but can't seem to get it to work properly. i do not know how to make it match only numbers.
ereg("([0-9]+)", $var);
if only letters are entered, it works, but if letters and numbers are entered, it does not. i am still very new at regexs so any help would be great.
thanks in advance.