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 |
Hi this is amul jani here, i complied my graduation in B.com stream.. but as career i looking for PHP language.. to get shape my career. so is that possible to enter in IT world.. for me how much scope of develop my career in this field.. amul jani
List some features of php that are deprecated in php7?
Is php required for wordpress?
Is php a low level language?
What is htaccess in php?
What is php written in?
Is laravel an oop?
What are differences between PECL and PEAR?
How to get seconds from current date using date function ?
8 Answers Sarna Technologies, Satyam,
How is it possible to know the number of rows returned in the result set?
What is php dependency injection?
How can we display the output directly to the browser?