RE: Displaying 2 digit minutes/seconds

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 

> -----Original Message-----
> From: sono-io@xxxxxxxxxxxxx [mailto:sono-io@xxxxxxxxxxxxx] 
> Sent: Thursday, August 20, 2009 3:53 PM
> To: Jonathan Tapicer; PHP General List
> Subject: Re:  Displaying 2 digit minutes/seconds
> 
> 
> On Aug 20, 2009, at 2:34 PM, Jonathan Tapicer wrote:
> 
> > You can use sprintf or str_pad to fill in with zeros, with sprintf  
> > you can do this:
> >
> > echo sprintf('%02d', 5);
> 
> 	Thanks, Jonathan!  I learned two new functions today!  
> Both work  
> great but I think I like sprintf for this application better since  
> it's more succinct.
> 
> echo sprintf('%02d', $theMinute);

Uh. If you MUST do this nonsense, then at least do this instead and not
"echo sprintf":

printf('%02d', $theMinute);


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux