Moron Posted January 13, 2009 Share Posted January 13, 2009 How do I do this? I don't want to PRINTF() something right here and now, but I want to format it so I can use substr() on it later. $endingdate = printf ("%08d", $RESULT['PSTUB5']); I want to zero-fill this field to make it eight characters (if the date is 1152009, I want it to be 01152009, etc...) Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted January 13, 2009 Share Posted January 13, 2009 Use sprintf <?php $endingdate = sprintf ("%08d", $RESULT['PSTUB5']); ?> Ken Quote Link to comment Share on other sites More sharing options...
Moron Posted January 13, 2009 Author Share Posted January 13, 2009 Use sprintf <?php $endingdate = sprintf ("%08d", $RESULT['PSTUB5']); ?> Ken You're a lifesaver. Thanks a ton! Quote Link to comment 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.