Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How do you format and output a number with leading zero's?

Answers were Sorted based on User's Feedback



How do you format and output a number with leading zero's?..

Answer / mahesh

$d=450;
$d = str_pad($d,6,0,0);
echo $d;
OUT PUT
000450

Is This Answer Correct ?    8 Yes 0 No

How do you format and output a number with leading zero's?..

Answer / pradeep

Using sprinf("%04d",$num);

The above function will return a number of length 4.

Is This Answer Correct ?    6 Yes 1 No

How do you format and output a number with leading zero's?..

Answer / mahidhar

syntax:number_format("number","decimal places","string
seperator","string thousands seperator");

Example:number_format('1000',2,'.','')

Is This Answer Correct ?    6 Yes 6 No

Post New Answer

More PHP Interview Questions

does PHP support foreign key and Rollback?yes or not.if not then why. how will you done these concept in php?

1 Answers   Avanigoradia, Primus Global,


What is difference between single quotes and double quotes in php?

0 Answers  


What does the arrow mean in php?

0 Answers  


What are the methods to submit form in php?

0 Answers  


How do you define a constant in php?

0 Answers  


Can php replace javascript?

0 Answers  


How can we determine whether a variable is set?

0 Answers  


How to make a class in php?

0 Answers  


Difference between get and post method.

0 Answers  


What is the meaning of symbol '$' in jquery?

0 Answers  


What is isset in php form?

0 Answers  


Which function would you use to merge two arrays in php?

0 Answers  


Categories