Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
PHP
add zeros in front of number php
MS.Kim
Programming language:
PHP
2021-03-28 16:20:58
0
Q:
add zeros in front of number php
user92331
Code:
PHP
2021-06-29 07:13:22
<?php $num = 4; $num_padded = sprintf("%02d", $num); echo $num_padded; // returns 04 ?>
0
Tags
number
php
add
zeros
Related
fix adding one more plus in php in loop
php add element to array first position
php num rows
pregmatch php only numbers and comma and dot
add two numbers in php
php add number to the existing name
take last four digits php
php hour between
php day without leading zero
add hour minute in datetime in php
php rounded to the nearest degree time with ms calculator
push array to first php
php pad leading zeros
prepend 0 to number php
php add element to beginning of associative array
php 0 padding left
php get last digit of number
php format int to 9 digits with preceding zeroes
php round to whole number
New to Communities?
Join the community