Leading zeroes in php

Posted by sanders on Stack Overflow See other posts from Stack Overflow or by sanders
Published on 2010-06-06T17:30:24Z Indexed on 2010/06/06 17:32 UTC
Read the original article Hit count: 169

Filed under:

Hello,

I would like to present a list from 0 to 59 of with the numbers 0 to 9 have a leading zero. This is my code but it doesn't work so far. Any idea's?

for($i=0; $i<60; $i++){
 if($i< 10){      
    sprintf("%0d",$i);
 }
   array_push($this->minutes,$i);
}

© Stack Overflow or respective owner

Related posts about php