I've searched the forums an come up empty handed. I'd like to verify a string has at least 1 letter and at least 1 number without using RegEx, is there a simple way?
Thanks!
| SitePoint Sponsor |
I've searched the forums an come up empty handed. I'd like to verify a string has at least 1 letter and at least 1 number without using RegEx, is there a simple way?
Thanks!
RegEx is the easiest way, but if you don't want to use that you'll have to walk the string like its an array checking each character for your two cases.
Thanks, you're right, got this far!
PHP Code:if(!eregi("[A-Z]",$string))
if(!ereg("[0-9]",$string))
Bookmarks