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

What does $_env means?

0 Answers  


How to redirect https to http url and vice versa in .htaccess?

0 Answers  


What is the use of friend function in php?

0 Answers  


What is the substitution of submit in PHP?

6 Answers   RedAlkemi,


What is default session time and path in PHP. How to change it?

0 Answers  


What is the main difference between require() and include()?

0 Answers  


How many ways there are to fetch the data from the Database?

2 Answers   Tops Technologies,


Does php class need constructor?

0 Answers  


How can we create a database using PHP and mysql?

3 Answers  


How to check a key exist in an array?

0 Answers  


What is overloading and overriding in php?

0 Answers  


What is session_start () in php?

0 Answers  


Categories