Jump to content
Sign in to follow this  
Intosia

Adding zero's infront of a int?

Recommended Posts

Intosia

Hi,

Is there a function like this?

$i = 3
$width = 3
$i = foo($i, $width)

$i is now '003'. So width is 3 then 12 becomes 012.

Hope u understand?

Share this post


Link to post
Share on other sites
MHz

There is StringFormat(). That function can pad zero's and such for the display of your Int as you show.

:)

Share this post


Link to post
Share on other sites
Intosia

Hmm ok :) I looked at the function in the help... but... i understand its something with the Width parameter, but i dont see how i should use it.... Can u give me a example? :D

Share this post


Link to post
Share on other sites
Intosia

Edit: Nevermind i got it, i looked it up in the PHP manual, they had a nice example

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×