Im not sure with the PHP of it however this is more of a c function which works exactly the same in PHP.
printf is just formated output. Basically you can have normal test and formatted text
[man]sprintf[/man] Manual page has information on the %f etc
however you have the following more common used
%s = String
%d = Decimal
%f = Float
Now you can add things to these formatted values there are more on the manual page but they are the more commonly used.
You can add number to it so e.g.
printf("%20d",100);
Would add a pad of 20 blank characters and starting from the right put the 100 on so it looks something like this
20
If you did it different like
printf("%20.2f",100);
You have made 100 a float and padded by 20 with 2 decimals required rounded up if necessary. so the output would be
100.00
You may need to view source to see it correctly.
I hope this helps