Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.