I am taking in a string from a text field and then sending it to a mysql database with the help of php, using just one variable called '$location'.
I am taking in a "City, State" from the text field.
My question is, is there anyway to enforce the format to be "city[space]comma[space]state"? There must be a comma between the city and the state but spaces are not necessary but a user may put spaces if they feel like and state can only be two letters long.
Also a city name can have a space in it. I.e., "Myrtle Creek, OR"
Thanks.