Reputation: 3
Looking for some help on how to validate a string in PHP.
My string contains:
all in one entry, so like 1234A12345
.
I need to make sure/validate this before inserting in the DB.
Can one of the wizard help me out there?
Upvotes: 0
Views: 4160
Reputation: 2887
This is a pretty simple regex:
/^\d{4}[a-zA-Z]\d{5}$/
And in case you haven't used regex in PHP before.
Upvotes: 3