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 csrf validation?
What is static variable in php?
Explain about the connective abilities of the PHP?
What are the advantages of object-oriented programming in php?
Who is the father of PHP and explain the changes in PHP versions?
13 Answers Befree, iMark Group, Netizen,
What do you mean by design patterns (php) ?
How can I load data from a text file into a table?
What is array function in javascript?
Write a program using while loop?
What is the function to count elements in an array in PHP?
does current version of mysql (myisam) supports foreign keys ?
=== represents what?
2 Answers Ephron Systems, NetTrackers,