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

Answer Posted / mahesh

$d=450;
$d = str_pad($d,6,0,0);
echo $d;
OUT PUT
000450

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is it worth learning php in 2019?

513


Is age interval or ordinal data?

515


What is the use of "ksort" in php?

496


What is xss in php?

555


How to call a php function from html button?

604






What are constructor and destructor in PHP?

538


Tell me how to retrieve a cookie value?

522


What is lazy loading in php?

499


Explain mixed and callback functions?

607


Is empty in php?

539


List the different types of print functions available in php?

534


How can we display information of a variable and readable by a human with php?

527


Is php secure?

520


What is difference between core php and framework?

456


Can you use both this () and super () in a constructor?

524