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 difference between sql and php?
How to download the files using PHP
at present am learning lamp course sir ..i want to know the carrer prospectus in php ...is there any companies recruiting freshers in chennai ..for freshers how much can i demand as a fresher in php ....?i finished my mca ..please sugggest me to face interview in php asking salary details and all please suggest me how much can i ask as a fresher in php ? and also tel is there any openings in chennai for recruting php freshers send their emails and company info please ? please send ur valuable suggestions to kiranpulsar2007@gmail.com i hope u wil reply to my question thank u guys bye take care see u soon all the best to everyone
what is the importence of session.save_path in Php.ini file and wht changes u've to made before using sesssions in ur php program first time?
How can I display text with a php script?
How to remove leading and trailing spaces from user input values?
What is the role of php?
Php code to find whether a number armstrong or not?
how can i disable multiple user in the same password in my website using any scripts
How do you match the character ^ at the beginning of the string? - ^^
Explain what is the static variable in function useful for?
i want the different aptitude questions on interview way