Posted by Jim Michaels on 02/16/06 00:20
<usenet@isotopeREEMOOVEmedia.com> wrote in message
news:98jsu1pkpuhasfudb7iksdp7h75jbc3sns@4ax.com...
> On Thu, 9 Feb 2006 14:02:04 -0800, "Jim Michaels"
> <jmichae3@nospam.yahoo.com>
> wrote:
>>"Colin McKinnon"
>><colin.thisisnotmysurname@ntlworld.deletemeunlessURaBot.com> wrote in
>>message news:74NAf.62520$Dg6.12645@newsfe3-gui.ntli.net...
>>> Fernando Rodredguez wrote:
>>>
>>>> How can I know if a string only has alfanumeric chars?
>>>>
>>>
>>> Use a regex.
>>>
>>> C.
>>
>>give him an example!
>>
>>preg_match('/^[\w\d]$/', $string);
>>
>
> Or use the built-in function.
> www.php.net/ctype_alpha
that's half of it. I think you meant www.php.net/ctype_alnum
admittedly, this looks much easier. :-)
[Back to original message]
|