I’m working on a legacy database table that has a phone no. field
but the problem is that all the entries (over 4k) are in varying
formats.
I was wondering if there was a quick way to fix them by looping through the records using PHP and updating the records to a particular phone format
4K doesn’t sound like many records at all.
And I’d bet that the varying formats fall into a finite number of combinations.
I wonder if it’d be possible with a few judicious SQL queries. If your RDBMS has regular expressions and string replacement functions you could manage it with a few UPDATE instructions. If not, any language with the capability of querying a database, doing string replacement, and updating would do the job.