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

What are objects in php?

532


Which cryptographic extension provide generation and verification of digital signatures?

527


Are objects passed by value or by reference?

552


Write a statement to show the joining of multiple comparisons in php?

536


in PHP for pdf which library used?

560






What is Gd PHP?

590


Explain object-oriented methodology in php?

584


What is csrf verification?

533


What is the difference between echo, print and printf()?

499


my english is not too good then what we apply for a php programer post

2020


What is php oops concepts?

528


What are the correct and the most two common way to start and finish a PHP block of code?

634


How many escape sequences are recognized in double-quoted strings?

543


What is str_replace()?

543


How to block direct directory access in PHP?

561