Link to home
Create AccountLog in
Avatar of businessesatoz
businessesatoz

asked on

preg_match

I have this code in  a cart application which uses to validate first name and last name.
!preg_match('/^([a-zA-Z\- ])+$/', $value)) return false;

Open in new window


It wont accept .(period) or , (comma) . I want them to accept. how to do that?
ASKER CERTIFIED SOLUTION
Avatar of Rik-Legger
Rik-Legger
Flag of undefined image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
!preg_match('/^([a-zA-Z\-, ])+$/', $value)) return false;

Open in new window

Avatar of businessesatoz
businessesatoz

ASKER

Thank you :)