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 traits? How it is used in php?
How will you sened requests from server1 to server2 from server2 to server3 and so on .. w/o letting the output come to the browser or say the client end in php
How check submit button is clicked in php?
What type of errors can be occurred in php?
How can we know the count/number of elements of an array?
Tell me how a constant is defined in a php script?
What is the difference between $name and $$name?
What is the importance of "method" attribute in a html form?
How many requests will be send to server and response coming from server when you open a web page (e.g. xyz.php) which has an image tag?
How can I execute a PHP script using command line?
i was set new individual folder for saving session values,the folder name is session and i set 777 permission,using session.save_path function like session.save_path "/home21b/sub004/sc21311-ULCX/candyoflove.com/session/" but it causing Warning: Unknown(): SAFE MODE Restriction in effect. The script whose uid/gid is 12112/12112 is not allowed to access /home21b/sub004/sc21311-ULCX/candyoflove.com/session owned by uid/gid 12267/12267 in Unknown on line 0 ,please tell what changes make this script, i was using .htaccesss file..plz help me....
What is the use of callback in php?