If you're not familiar with these PHP functions, read this documentation: printf() / sprintf().
All template code requires validation: if a variable (or array key/value) doesn't exist or doesn't contain data, we don't want to print empty HTML. Writing "pure" PHP with s/printf() for markup makes validation logic easier to see and shorter to write.