本文介绍了PHP正则表达式美国地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想看看验证美国地址的好方法是什么,我知道可能没有正确的方法来执行此操作,但我将采用基本方法:#,街道名称、城市、州和邮政编码.
I'm trying to see what would be a good way to validate a US address, I know that there might be not a proper way of doing this, but I'm going for the basic way: #, Street name, City, State, and Zip Code.
任何想法将不胜感激.谢谢
Any ideas will be appreciate it. Thanks
推荐答案
不要尝试.有人可能有一个邮政信箱,或一个公寓号码等,他们会非常生气.即使是普通"的街道名称也可以有数字,例如纽约市的第 125 街(以及许多其他街道).即使是郊区也可以有一些街道编号.
Don't try. Somebody is likely to have a post office box, or an apartment number etc., and they will be really irate with you. Even a "normal" street name can have numbers, like 125th Street (and many others) in New York City. Even a suburb can have some numbered streets.
城市名称可以有空格.
这篇关于PHP正则表达式美国地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!