Hi,
I'm trying to pad a time (playtime of an MP3) using sprintf() in PHP.
sprintf("%02d:2d:2d", $time);
The function that returns the time gets, for example, '1:56' if the MP3 is 1 minute 56 seconds long, and that call brings back "01:56:00" (whereas it needs to be 00:01:56). How can I make this work? How can I tell sprintf to pad on the left?
Or is there a better way to go about this? A more appropriate function maybe?
Thanks