James Cridland's blog

A radio futurologist writing about what happens when radio and new platforms collide

« | Blog index | »

Formatting UK telephone numbers

Posted on Tuesday, August 31st, 2010 at 10:08am. #

These red telephone boxes are queuing for something

Fifteen years ago, I was working in Sheffield when “PhoneDay” happened – the big switch from 0742 to 0114.

Note how I didn’t say 01142. No. That would be wrong. Sheffield phone numbers are all 0114 xxx xxxx, but when they changed, all of the local bits – the xxx xxxx – started with a ’2′. They don’t any more.

Formatting UK phone numbers is a nuisance; but Media UK’s been doing it moderately right over the past fifteen years. Now we’re doing it perfectly, thanks to this page where, towards the bottom, you’ll find the complete “programmer’s pattern” for formatting UK telephone numbers.

I’ve published the PHP code I use to format UK telephone numbers correctly on this website: it’s a bit nastily formatted, but it’s the actual code that Media UK uses (hence the rather odd function name). You’re welcome to use this code however you want.

If you’re a PHP programmer and can make it prettier and better, please do shout.

8 comments

Adam Bowie
commenting at August 31st, 2010 at 10:16am

It’s just over ten years since London changed from 0171 and 0181 to (020) 7xxx xxxx or (020) 8xxx xxxx.

And large numbers of businesses – including radio stations – still don’t really understand how telephone codes work. The London code is 020 followed by an eight digit number. If you’re reading out your number as 0207 followed by a seven digit number, then you’re wrong.

I feel like that David Mitchell character in the otherwise hit-or-miss recent series of Mitchell & Webb who commits cold-blooded murder when people say “haitch” instead of “aitch” when referring to the letter that comes after G in the alphabet.

Paul Easton
commenting at August 31st, 2010 at 10:35am

Totally agree with Adam – including the bit about people who say “haitch” – re. people who don’t use the number correctly.

There are also, of course, 020 3xxx xxxx numbers in London.

James Cridland
commenting at August 31st, 2010 at 10:46am

Indeed, I discover that 020 7xxx xxxx numbers are now being given to people throughout London, not just in the centre – and vice-versa. (I’d be quite peeved to get an 020 8xxx number in central London!)

I had an 020 3 number for some time; it is the default when purchasing an online London number from Skype. I now have 020 7100 1811, which is much more posh looking, as Media UK’s main reception number. (I say ‘reception’, it’s not really.)

Adam Bowie
commenting at August 31st, 2010 at 10:49am

Surely whether your number begins 7, 8, 3 or whatever matters very little these days? Aside from businesses, who actually uses a landline anyway?

(Interesting aside, if someone from Global in London phones you, it comes from an 8xxx xxxx number, whereas their Leicester Square numbers are all 7xxx xxxx numbers to the best of my knowledge)

John Handelaar
commenting at August 31st, 2010 at 2:27pm

(That’s because Chrysalis really was in 081-land.)

John Medd
commenting at August 31st, 2010 at 8:01pm

We had the same thing in Nottingham: 0602 became 0115 9. You London boys lost your exclusive rights, however, when you waved goodbye to 01. Back in the day, there was always a certain kudos in dialling an 01 number. What bugs me most is when people give you a telephone number to write down and do it in increments of two numbers: ‘that’s 07 97 34…’ and so on. Maybe it’s just me.

Ash
commenting at September 2nd, 2010 at 11:28am

I have got a land line installed in Kingston, and got an 020 8 number. Was hoping for a 3!

Glenn Williams
commenting at January 7th, 2012 at 2:30pm

Thanks SO much for pointing me to that website. Just what I needed. You have just saved me lots of work.

cheers

glenn
tinylion development uk

Leave a comment

Here's my commenting policy