Jump to content

Converting Numbers


QueenZ

Recommended Posts

can i ask why you are removing 0's and then wanting to put them back?

 

i don't want to remove then and then put them back.. these are 2 different arrays i'm working with..

from one i need to remove them and to another one i need to add them...

Link to comment
https://forums.phpfreaks.com/topic/120003-converting-numbers/#findComment-618165
Share on other sites

Using consistent array indexing actually helps you know... ;)

 

Anyway... if your indexes are within 01 to 99 then

 

function addZero($number) {

if ($number < 10) $number = "0".$number;

return $number;

}

 

 

right... but i think it's without "" as it's string... $number = 0 . $number

Link to comment
https://forums.phpfreaks.com/topic/120003-converting-numbers/#findComment-618178
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.