Answers for "padding number in php"

PHP
0

padding number in php

$number = 12;
$width = 4;
$padded = str_pad((string)$number, $width, "0", STR_PAD_LEFT);
Posted by: Guest on September-03-2021

Browse Popular Code Answers by Language