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

What is the use of isset() in php?

536


How many keywords are there in php?

621


How do you put a space in html?

520


How to check an element is exists in array or not in php?

583


Is age interval or ordinal?

525






What is session cookies php?

549


How to copy a file?

565


Explain the types of string comparision function in PHP

516


Is a number php?

528


Is it possible to destroy a cookie?

542


How would you declare a function that receives one parameter name hello?

523


Do you know what are traits?

536


Tell me what is the difference between ereg_replace() and eregi_replace()?

548


What is Different between Joomla And Magento?

2275


What is strcmp () in php?

533