hi there, i’m trying to validate just numbers in a given variable, here`s da code;
$aka=00;
if (ereg('[0-9]',$aka)) {
echo ("no letters");
}else{
echo("str contain letters");
}
well, this works fine for $aka=1234 or $aka=asd, but it doesen’t handle the num/char mix, by example if var $aka = 0a2, i get a blank page w/nothing displayed, and if i put this $aka = k9 it evaluates to true ( “no leters” ?) but $aka = 9k displays nothing.
can some one helpme?
thanx in advance & an apologuise 4 the really bad english…