David Preston

Musings of an old bloke.



May 2012

Posts 1 to 2 of 2

Prime Minister Follows Parody Darth Vader On Twitter

I’m not sure if this is good, bad, cool, uncool or just plain weird. The official Twitter account of the British Prime Minister follows a spoof Darth Vader account! Well, I suppose Cameron is something of a parody of a Prime Minister anyway, so why… View More

Tidying & Formatting Postal Addresses in PHP

A couple of times in the course of my job, I've needed to tidy-up user input of postal addresses, usually when importing from an external database into a web application or taking input from a web form. It looks horrible when everything is in upper or lower case. PHP has strtoupper(), strtolower() and ucasewords() functions, but none of these does just what I needed. Googling found a few attempts to solve the same problem, and I've probably… View More