adzie Posted November 16, 2008 Share Posted November 16, 2008 Hello again, Im wanting to turn a number into a minute currently the variable $minsdiff shows :2 for two minutes but I'd like it to show :02 or :05 etc any direction appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/132959-time-format/ Share on other sites More sharing options...
wildteen88 Posted November 16, 2008 Share Posted November 16, 2008 PHP nocks of the 0 at the front of integers. to output a 0 at the beginning of single digit number look into sprintf example: $numb = 1; echo sprintf('%02d', $numb); Quote Link to comment https://forums.phpfreaks.com/topic/132959-time-format/#findComment-691423 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.