Yes, of course, [man]sprintf[/man]. Now, if there were only a simple way to convert the ascii value of a lowercase letter to it's numerical place in the alphabet... do you think there's an available function in PHP for that? 😉
Hobbit, instead of your select...case statement, try this:
$alpha = ord(strtolower($my_letter)) - 96;