How do you format and output a number with leading zero's?
Answers were Sorted based on User's Feedback
Answer / mahesh
$d=450;
$d = str_pad($d,6,0,0);
echo $d;
OUT PUT
000450
Is This Answer Correct ? | 8 Yes | 0 No |
Answer / pradeep
Using sprinf("%04d",$num);
The above function will return a number of length 4.
Is This Answer Correct ? | 6 Yes | 1 No |
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 |
How does csrf attack work?
What is cookies? How to create cookies in php?
What is difference between variable declaration and variable definition?
what is the difference between mysql_fetch_array() and mysql_fetch_row()?
Explain the visibility of the property or method?
What is super () python?
How many bootable file in O/S - XP,2000, and 98. which are the files.
Who created numbers?
What are the current versions of apache, PHP, and mysql?
Is php 5.6 secure?
Explain the advantages of using PHP?
hi, i have knowledge about PHP/MYSQL,i am fresher of M.Sc-IT 2009 pass out,any recruitment in PHP please let me know.my email id:nathiyasms@gmail.com