[eluser]Code Arachn!d[/eluser]
for semantic reasons it may make sense to use "get_extension" as the function name instead of format - because technically you're not really getting the format just the "file extension" for the uri... that's my 2 cent - otherwise both of these are great ways to tackle this issue.