$str = 8
$result = str_pad($str, 4, 0, STR_PAD_LEFT);
echo $result;
0008
또는
$a = 8;
$new_a = sprintf("%04d", $a);
0008
$str = 8
$result = str_pad($str, 4, 0, STR_PAD_LEFT);
echo $result;
0008
또는
$a = 8;
$new_a = sprintf("%04d", $a);
0008