View Single Post
Old 09-19-2005, 07:39 PM   #2 (permalink)
taylor
Junior Member
 
Join Date: Aug 2005
Posts: 28
Default

Most times numbers are not part of a name. But apostrophes, spaces, dashes, periods and commas might or can be.

PHP variable names must begin with "$" so this eaxample may help:
PHP Code:
for($i=0;$i<strlen($name);$i++)
{
   if((
$char[i]<'a' ||$char[i]>'z')&&($char[i]<'A' ||$char[i]>'Z'))
   {
   return 
FALSE;
   }
  return 
TRUE;

With PHP you could also use a regular expression engine that would allow the above to be done without the loop.

cheers
taylor is offline   Reply With Quote
Sponsored Links