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 |
What is mysqli_fetch_array?
How can we enable error reporting in php?
How can image properties be retrieved in php?
Does apache use php?
Why is used in php?
"$this" what type of object it is?
when ever the user logged in the database table the current registered date will be appeared
In PHP how many size data can upload by default?
9 Answers Classic Infotech, PG Software,
How to link one site backend to another site frontend?
Explain different sorting function in php?
Is it possible to remove the html tags from data?
What is PHP?