Normalize telephone numbers


/ Published in: PHP
Save to your folder(s)

This snippet is usable for telephone number normalization. It supports re-mapping of misused alphabetical characters (e.g. i for 1) and some other clean up stuff... Take a look.

Update, 2009-10-02: added function to create a corresponding MySQL REPLACE construct to normalize data which is already stored in database. I decided to use this approach because MySQL's regular expression engine is very slow. TODO: add the possibility to remove non digit characters at the end of the laaaarge REPLACE call.

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.