shan_cool Posted February 14, 2006 Share Posted February 14, 2006 Hi all,I hav a text field in which the data must be provided in A233784545 format. i mean the intial starting letter must b a character and all other letters can either be numeric or characters.... help me how to validate this.... am using PHP .Rhds,Shan...Chennai,India. Quote Link to comment https://forums.phpfreaks.com/topic/3421-init-character-checking/ Share on other sites More sharing options...
janroald Posted February 14, 2006 Share Posted February 14, 2006 [!--quoteo(post=345601:date=Feb 14 2006, 09:43 AM:name=shan_cool)--][div class=\'quotetop\']QUOTE(shan_cool @ Feb 14 2006, 09:43 AM) [snapback]345601[/snapback][/div][div class=\'quotemain\'][!--quotec--]Hi all,I hav a text field in which the data must be provided in A233784545 format. i mean the intial starting letter must b a character and all other letters can either be numeric or characters.... help me how to validate this.... am using PHP .Rhds,Shan...Chennai,India.[/quote][a href=\"http://www.google.no/search?hl=no&q=php+validation\" target=\"_blank\"]http://www.google.no/search?hl=no&q=php+validation[/a][a href=\"http://www.google.no/search?hl=no&q=javascript+validation\" target=\"_blank\"]http://www.google.no/search?hl=no&q=javascript+validation[/a]PHPif(preg_match("/^[a-Z]\w+/",$text_field)) { }will match a string starting with a word character and continues with 1 or more word characters Quote Link to comment https://forums.phpfreaks.com/topic/3421-init-character-checking/#findComment-11689 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.