/ Published in: PHP
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.
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.