how about doing a single strtolower on $extension so that we don't call it twice?