Posted by NC on 01/21/06 23:49
NC wrote:
> Fernando Rodríguez wrote:
> >
> > How can I know if a string only has alfanumeric chars?
>
> By feeding it to is_numeric():
Oops, sorry, didn't read the question carefully...
"Alphanumeric" is a context-dependent concept. For example, ASCII 247
is not alphanumeric in Latin-1, but it does in fact correspond to a
letter in Cyrillic-1251...
What you may want to do is to define "alphanumeric" more precisely and
then look at each character in the sting to see if it meets your
definition of "alphanumeric".
Cheers,
NC
[Back to original message]
|