最好是以一些规范格式或“输入”来存储电话号码? [英] Is it better to store telephone numbers in some canonical format or "as entered"?

查看:292
本文介绍了最好是以一些规范格式或“输入”来存储电话号码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以某种规范格式存储电话号码从程序员角度来看具有几个优点,但如果突然输入的数字看起来可能会混淆用户很多不同。

Storing a telehone number in some kind of canonical format has several advantages from a programmers point of view, but it might confuse the user, if suddenly his entered numbers look a lot different.

有什么方法?

推荐答案

原始输入乱序,但也会在数据库中插入一个清理过的表单。这只保持数字少标点符号和空格。使用清除的表单将允许轻松查找,而不必担心不同的可能输入的样式。

I would keep the original entered mess but would also insert a cleaned up form in the database. Which only kept the numbers less punctuation and spaces. Using the cleaned form would allow easy lookups without worrying about different possible entered styles.

这篇关于最好是以一些规范格式或“输入”来存储电话号码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆