Jump to content

[SOLVED] integers with leading zeros


AdRock

Recommended Posts

Just come across a problem i need to fix.

 

I connect to database and count the number of rows which could be 2 or more.

 

I need to create numbers based on the row count so if there is 15 rows in the database, i need my variable to be 015 or if there is only 2 rows i need 002.

 

I can get the row count and apply it to a variable but how do i add leading zeros so my variable is always 3 digits long?

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/154117-solved-integers-with-leading-zeros/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.