PDA

View Full Version : PHP help - Validation for NRIC using ereg or preg_match


booker
12-03-2004, 11:41 PM
Hi, how do I validate for Singapore NRIC numbers using ereg or preg_match in the format sXXXXXXXa

s - a must have
X - any numerical value
a - any alphabet

the nric must have 9 characters.

Thanks alot ! :p

Fr33styl3r
22-03-2004, 08:24 PM
Both can be used with different conditions.

for more info,

http://sg.php.net/eregi_replace
http://sg.php.net/preg_match

php.net has great resources which are available from other developers.