validation

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Lphp
Forum Commoner
Posts: 74
Joined: Sun Jun 26, 2011 9:56 pm

validation

Post by Lphp »

(!preg_match('/[a-zA-Z]/', $_POST['interest']) I would like my validation is letter and space ( in any position) how can I handle that?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: validation

Post by Christopher »

(!preg_match('/^[a-zA-Z\ ]*$/', $_POST['interest'])
(#10850)
Lphp
Forum Commoner
Posts: 74
Joined: Sun Jun 26, 2011 9:56 pm

Re: validation

Post by Lphp »

on this case all the empty input , I don't want the empty input , I only want a lease one letter , and you can have space between letter
Thankyou
Post Reply