View Single Post
  #10 (permalink)  
Old 10-06-09, 09:36 PM
PopSmith PopSmith is offline
Newbie Coder
 
Join Date: May 2009
Posts: 18
Thanks: 5
Thanked 0 Times in 0 Posts
I was looking over my previous response and realized that I didn't make any sense, compared to what I really meant to ask about.

I am actually looking for clarification on the preg_match function as I used here:

php Code:
  1. //Validate the first name
  2. return preg_match("/^
  3. [a-zA-Z]
  4. [a-zA-Z._]{1,15}$/ix", $c_fname );

I am thinking that my above use of preg_match would validate that the $c_fname variable, which is the sanitized output of the variable $first_name, contains only characters a-z in either upper or lower case as well as the period or underscore. The {1,15} would limit the preg_match to between 1 and 15 characters.

However, I could (and probably am) wrong in my thinking.