How do you format and output a number with leading zero's?

Answer Posted / pradeep

Using sprinf("%04d",$num);

The above function will return a number of length 4.

Is This Answer Correct ?    6 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to use http headers inside php?

778


Tell me how can we determine whether a variable is set?

698


How to do single and multi line comment in php?

750


What is framework in php for beginners?

724


What is different types of visibility?

705


What are the popular frameworks in php?

717


Can I run php without xampp?

696


Php being an open source is there any support available to it?

832


What is config file in php?

752


What is the meaning of a persistent cookie?

747


What happens when submit button is clicked?

712


Can we use include ("xyz.php") two times in a php page "index.php"?

787


Why php language is used?

720


What is the empty function?

732


Is php still in demand?

756