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. 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 Link to comment https://forums.phpfreaks.com/topic/3421-init-character-checking/#findComment-11689 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.